Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move cmaes.py from core to baselines #200

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/api_documentation/core/cmaes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# CMAES class

::: qdax.core.cmaes.CMAES
::: qdax.baselines.cmaes.CMAES
2 changes: 1 addition & 1 deletion examples/cmaes.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
File renamed without changes.
4 changes: 1 addition & 3 deletions qdax/core/containers/unstructured_repertoire.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,7 @@ def intra_batch_comp(

# We want to eliminate the same individual (distance 0)
fitness = jnp.where(knn_relevant_indices == current_index, False, fitness)
current_fitness = jnp.squeeze(
eval_scores.at[knn_relevant_indices.at[0].get()].get()
)
current_fitness = jnp.squeeze(eval_scores.at[current_index].get())

# Is the fitness of the other individual higher?
# If both are True then we discard the current individual since this individual
Expand Down
2 changes: 1 addition & 1 deletion qdax/core/emitters/cma_emitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion qdax/core/emitters/cma_mega_emitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion qdax/core/emitters/cma_rnd_emitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/core_test/cmaes_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Loading