diff --git a/HISTORY.md b/HISTORY.md index c3aa215b7..0002a8616 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -19,7 +19,7 @@ #### Documentation -- Add novelty search with CMA-ES to sphere example ({pr}`478`) +- Add novelty search with CMA-ES to sphere example ({pr}`478`, {pr}`482`) #### Improvements diff --git a/examples/sphere.py b/examples/sphere.py index e2d156ef8..3a4d01447 100644 --- a/examples/sphere.py +++ b/examples/sphere.py @@ -47,6 +47,9 @@ GradientArborescenceEmitter using ImprovementRanker. - `ns_cma`: Novelty Search with CMA-ES; implemented using a ProximityArchive with EvolutionStrategyEmitter. Results are stored in a passive GridArchive. +- `nslc_cma_imp`: EvolutionStrategyEmitter with a ProximityArchive with local + competition turned on. Thus, the archive returns two-stage improvement + information that is fed to the EvolutionStrategyEmitter just like in CMA-ME. The parameters for each algorithm are stored in CONFIG. The parameters reproduce the experiments presented in the paper in which each algorithm is @@ -608,6 +611,8 @@ "archive": { "class": ProximityArchive, "kwargs": { + # Hyperparameters from Density Descent paper: + # https://arxiv.org/abs/2312.11331 "k_neighbors": 15, "novelty_threshold": 0.037 * 512, } @@ -627,6 +632,37 @@ "kwargs": {} } }, + "nslc_cma_imp": { + "dim": 100, + "iters": 5000, + "archive_dims": (100, 100), + "use_result_archive": True, + "is_dqd": False, + "batch_size": 36, + "archive": { + "class": ProximityArchive, + "kwargs": { + "k_neighbors": 15, + # Note: This is untuned. + "novelty_threshold": 0.037 * 100, + "local_competition": True, + } + }, + "emitters": [{ + "class": EvolutionStrategyEmitter, + "kwargs": { + "sigma0": 0.5, + "ranker": "2imp", + "selection_rule": "filter", + "restart_rule": "no_improvement" + }, + "num_emitters": 15 + }], + "scheduler": { + "class": Scheduler, + "kwargs": {} + } + }, } diff --git a/tests/examples.sh b/tests/examples.sh index ef1217c77..fa8de7389 100644 --- a/tests/examples.sh +++ b/tests/examples.sh @@ -49,6 +49,7 @@ python examples/sphere.py cma_mega_adam --dim 20 --itrs 10 --outdir "${SPHERE_OU python examples/sphere.py cma_mae --dim 20 --itrs 10 --learning_rate 0.01 --outdir "${SPHERE_OUTPUT}" python examples/sphere.py cma_maega --dim 20 --itrs 10 --learning_rate 0.01 --outdir "${SPHERE_OUTPUT}" python examples/sphere.py ns_cma --dim 20 --itrs 10 --outdir "${SPHERE_OUTPUT}" +python examples/sphere.py nslc_cma --dim 20 --itrs 10 --outdir "${SPHERE_OUTPUT}" # lunar_lander.py install_deps examples/lunar_lander.py