From b2ef13ef69044bb1371ee3eebb299c98bf5a6341 Mon Sep 17 00:00:00 2001 From: LisaCoiffard <91796648+LisaCoiffard@users.noreply.github.com> Date: Fri, 20 Sep 2024 18:24:34 +0100 Subject: [PATCH] chore: Move `cmaes.py` from `core` to `baselines` (#200) * Move cmaes.py from core to baselines * Change corresponding api docs --------- Authored-by: Lisa --- docs/api_documentation/core/cmaes.md | 2 +- examples/cmaes.ipynb | 2 +- mkdocs.yml | 2 +- qdax/{core => baselines}/cmaes.py | 0 qdax/core/emitters/cma_emitter.py | 2 +- qdax/core/emitters/cma_mega_emitter.py | 2 +- qdax/core/emitters/cma_rnd_emitter.py | 2 +- tests/core_test/cmaes_test.py | 2 +- 8 files changed, 7 insertions(+), 7 deletions(-) rename qdax/{core => baselines}/cmaes.py (100%) diff --git a/docs/api_documentation/core/cmaes.md b/docs/api_documentation/core/cmaes.md index 257bb89b..5c85704a 100644 --- a/docs/api_documentation/core/cmaes.md +++ b/docs/api_documentation/core/cmaes.md @@ -1,3 +1,3 @@ # CMAES class -::: qdax.core.cmaes.CMAES +::: qdax.baselines.cmaes.CMAES diff --git a/examples/cmaes.ipynb b/examples/cmaes.ipynb index ba059cdc..023b2e27 100644 --- a/examples/cmaes.ipynb +++ b/examples/cmaes.ipynb @@ -55,7 +55,7 @@ "import matplotlib.pyplot as plt\n", "from matplotlib.patches import Ellipse\n", "\n", - "from qdax.core.cmaes import CMAES" + "from qdax.baselines.cmaes import CMAES" ] }, { diff --git a/mkdocs.yml b/mkdocs.yml index 9207b4f2..b447e83f 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -154,11 +154,11 @@ nav: - DADS: api_documentation/core/dads.md - SAC: api_documentation/core/sac.md - TD3: api_documentation/core/td3.md - - CMAES: api_documentation/core/cmaes.md - Genetic Algorithm: api_documentation/core/genetic_algorithm.md - NSGA2: api_documentation/core/nsga2.md - SPEA2: api_documentation/core/spea2.md - PBT: api_documentation/core/pbt.md + - CMAES: api_documentation/core/cmaes.md - Containers: api_documentation/core/containers.md - Emitters: api_documentation/core/emitters.md - Neuroevolution: api_documentation/core/neuroevolution.md diff --git a/qdax/core/cmaes.py b/qdax/baselines/cmaes.py similarity index 100% rename from qdax/core/cmaes.py rename to qdax/baselines/cmaes.py diff --git a/qdax/core/emitters/cma_emitter.py b/qdax/core/emitters/cma_emitter.py index 315dcd9b..e3b476dd 100644 --- a/qdax/core/emitters/cma_emitter.py +++ b/qdax/core/emitters/cma_emitter.py @@ -7,7 +7,7 @@ import jax import jax.numpy as jnp -from qdax.core.cmaes import CMAES, CMAESState +from qdax.baselines.cmaes import CMAES, CMAESState from qdax.core.containers.mapelites_repertoire import ( MapElitesRepertoire, get_cells_indices, diff --git a/qdax/core/emitters/cma_mega_emitter.py b/qdax/core/emitters/cma_mega_emitter.py index c3f87fed..976f528b 100644 --- a/qdax/core/emitters/cma_mega_emitter.py +++ b/qdax/core/emitters/cma_mega_emitter.py @@ -6,7 +6,7 @@ import jax import jax.numpy as jnp -from qdax.core.cmaes import CMAES, CMAESState +from qdax.baselines.cmaes import CMAES, CMAESState from qdax.core.containers.mapelites_repertoire import ( MapElitesRepertoire, get_cells_indices, diff --git a/qdax/core/emitters/cma_rnd_emitter.py b/qdax/core/emitters/cma_rnd_emitter.py index 27e4f0db..0715c437 100644 --- a/qdax/core/emitters/cma_rnd_emitter.py +++ b/qdax/core/emitters/cma_rnd_emitter.py @@ -6,7 +6,7 @@ import jax import jax.numpy as jnp -from qdax.core.cmaes import CMAESState +from qdax.baselines.cmaes import CMAESState from qdax.core.containers.mapelites_repertoire import MapElitesRepertoire from qdax.core.emitters.cma_emitter import CMAEmitter, CMAEmitterState from qdax.custom_types import Descriptor, ExtraScores, Fitness, Genotype, RNGKey diff --git a/tests/core_test/cmaes_test.py b/tests/core_test/cmaes_test.py index 16321fd4..daa7ce9d 100644 --- a/tests/core_test/cmaes_test.py +++ b/tests/core_test/cmaes_test.py @@ -4,7 +4,7 @@ import jax.numpy as jnp import pytest -from qdax.core.cmaes import CMAES +from qdax.baselines.cmaes import CMAES def test_cmaes() -> None: