From 0a67406a57fcf11ba91175dbea95c2aabaa7bf01 Mon Sep 17 00:00:00 2001 From: Vincent Auriau Date: Mon, 26 Aug 2024 16:39:28 +0200 Subject: [PATCH] Fix logos on doc landing page (#153) * FIX: logos sizes in mkdocs landing page --- .../models/latent_class_base_model.py | 2 + docs/index.md | 55 ++++++------------- mkdocs.yaml | 1 + notebooks/models/latent_class_model.ipynb | 10 ++-- 4 files changed, 24 insertions(+), 44 deletions(-) diff --git a/choice_learn/models/latent_class_base_model.py b/choice_learn/models/latent_class_base_model.py index b3889636..b2606cff 100644 --- a/choice_learn/models/latent_class_base_model.py +++ b/choice_learn/models/latent_class_base_model.py @@ -257,6 +257,7 @@ def fit(self, choice_dataset, sample_weight=None, verbose=0): return self._fit_with_lbfgs( choice_dataset=choice_dataset, sample_weight=sample_weight, verbose=verbose ) + if self.optimizer.lower() == "adam": self.optimizer = tf.keras.optimizers.Adam(self.lr) elif self.optimizer.lower() == "sgd": @@ -640,6 +641,7 @@ def _fit_with_gd( ) train_logs["train_loss"].append(neg_loglikelihood) + # temps_logs = {k: tf.reduce_mean(v) for k, v in train_logs.items()} # self.callbacks.on_train_batch_end(batch_nb, logs=temps_logs) diff --git a/docs/index.md b/docs/index.md index 2662ece2..d550b26d 100644 --- a/docs/index.md +++ b/docs/index.md @@ -127,42 +127,19 @@ The use of this software is under the MIT license, with no limitation of usage, Choice-Learn has been developed through a collaboration between researchers at the Artefact Research Center and the laboratory MICS from CentraleSupélec, Université Paris Saclay. -
- - ![Elements](https://raw.githubusercontent.com/artefactory/choice-learn/main/docs/illustrations/logos/logo_arc.png){: style="height:60px"} - - ![Dandi](https://raw.githubusercontent.com/artefactory/choice-learn/main/docs/illustrations/logos/logo_atf.png){: style="height:60px"} -
- -

- - - -   -   - - - - -

- -

- - - -   -   - - - -   -   - - - -   -   - - - -

+
+[![ARC](https://raw.githubusercontent.com/artefactory/choice-learn/main/docs/illustrations/logos/logo_arc.png){: style="height:60px"}](https://www.artefact.com/data-consulting-transformation/artefact-research-center/) +     +[![FNG](https://raw.githubusercontent.com/artefactory/choice-learn/main/docs/illustrations/logos/logo_atf.png){: style="height:65px"}](https://www.artefact.com/) + +[![PS](https://raw.githubusercontent.com/artefactory/choice-learn/main/docs/illustrations/logos/logo_paris_saclay.png){: style="height:60px"}](https://www.universite-paris-saclay.fr/) +     +[![CS](https://raw.githubusercontent.com/artefactory/choice-learn/main/docs/illustrations/logos/logo_CS.png){: style="height:65px"}](https://mics.centralesupelec.fr/) +     +     +[![LBS](https://raw.githubusercontent.com/artefactory/choice-learn/main/docs/illustrations/logos/logo_lbs.jpeg){: style="height:60px"}](https://www.london.edu/) +     +     +[![INSEAD](https://raw.githubusercontent.com/artefactory/choice-learn/main/docs/illustrations/logos/logo_insead.png){: style="height:65px"}](https://www.insead.edu/) + +
diff --git a/mkdocs.yaml b/mkdocs.yaml index f22b11f3..e7ff24a2 100644 --- a/mkdocs.yaml +++ b/mkdocs.yaml @@ -27,6 +27,7 @@ theme: favicon: logo_choice_learn.png markdown_extensions: + - attr_list - pymdownx.highlight: anchor_linenums: true line_spans: __span diff --git a/notebooks/models/latent_class_model.ipynb b/notebooks/models/latent_class_model.ipynb index a1d6a84c..db2643bd 100644 --- a/notebooks/models/latent_class_model.ipynb +++ b/notebooks/models/latent_class_model.ipynb @@ -62,8 +62,8 @@ "metadata": {}, "outputs": [], "source": [ - "lc_model = LatentClassSimpleMNL(n_latent_classes=3, fit_method=\"mle\", optimizer=\"lbfgs\", epochs=1000, tolerance=1e-10)\n", - "hist = lc_model.fit(elec_dataset, verbose=1)" + "lc_model = LatentClassSimpleMNL(n_latent_classes=3, fit_method=\"mle\", optimizer=\"lbfgs\", epochs=1000, tolerance=1e-20)\n", + "hist, results = lc_model.fit(elec_dataset, verbose=1)" ] }, { @@ -85,8 +85,8 @@ "metadata": {}, "outputs": [], "source": [ - "print(\"Negative Log-Likelihood:\")\n", - "lc_model.evaluate(elec_dataset) * len(elec_dataset)" + "nll = (lc_model.evaluate(elec_dataset) * len(elec_dataset)).numpy()\n", + "print(f\"Negative Log-Likelihood: {nll}\")" ] }, { @@ -277,7 +277,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.4" + "version": "3.8.18" } }, "nbformat": 4,