From d9fb0f1a7e9787d60366a3830d185f514cfac3ad Mon Sep 17 00:00:00 2001 From: Bill Huang Date: Mon, 4 Sep 2023 23:21:17 +0800 Subject: [PATCH] dev: rename class name xNES -> XNES --- docs/source/api/algorithms/so/nes.rst | 2 +- src/evox/algorithms/so/es_variants/__init__.py | 4 ++-- src/evox/algorithms/so/es_variants/nes.py | 2 +- src/evox/algorithms/so/es_variants/open_es.py | 2 +- tests/test_single_objective_algorithms.py | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/source/api/algorithms/so/nes.rst b/docs/source/api/algorithms/so/nes.rst index 0f2d6cbf..d450fec1 100644 --- a/docs/source/api/algorithms/so/nes.rst +++ b/docs/source/api/algorithms/so/nes.rst @@ -2,7 +2,7 @@ xNES ==== -.. autoclass:: evox.algorithms.xNES +.. autoclass:: evox.algorithms.XNES :members: .. autoclass:: evox.algorithms.SeparableNES diff --git a/src/evox/algorithms/so/es_variants/__init__.py b/src/evox/algorithms/so/es_variants/__init__.py index 3beea101..b3670a56 100644 --- a/src/evox/algorithms/so/es_variants/__init__.py +++ b/src/evox/algorithms/so/es_variants/__init__.py @@ -7,7 +7,7 @@ from .esmc import ESMC from .guided_es import GuidedES from .ma_es import MAES, LMMAES -from .nes import xNES, SeparableNES +from .nes import XNES, SeparableNES from .noise_reuse_es import Noise_reuse_es from .open_es import OpenES from .persistent_es import PersistentES @@ -24,4 +24,4 @@ def LES(*args, **kwargs): raise ImportError( f'LES requires flax but got "{original_erorr_msg}" when importing' - ) \ No newline at end of file + ) diff --git a/src/evox/algorithms/so/es_variants/nes.py b/src/evox/algorithms/so/es_variants/nes.py index 114cda2b..646eaf44 100644 --- a/src/evox/algorithms/so/es_variants/nes.py +++ b/src/evox/algorithms/so/es_variants/nes.py @@ -1,7 +1,7 @@ # -------------------------------------------------------------------------------------- # This code implements algorithms described in the following papers: # -# Title: Exponential Natural Evolution Strategies (xNES) +# Title: Exponential Natural Evolution Strategies (XNES) # Link: https://dl.acm.org/doi/abs/10.1145/1830483.1830557 # # Title: Natural Evolution Strategies (SeparableNES) diff --git a/src/evox/algorithms/so/es_variants/open_es.py b/src/evox/algorithms/so/es_variants/open_es.py index ad7866fb..a0ec8b71 100644 --- a/src/evox/algorithms/so/es_variants/open_es.py +++ b/src/evox/algorithms/so/es_variants/open_es.py @@ -1,7 +1,7 @@ # -------------------------------------------------------------------------------------- # This code implements algorithms described in the following papers: # -# Title: Exponential Natural Evolution Strategies (xNES) +# Title: Exponential Natural Evolution Strategies (XNES) # Link: https://dl.acm.org/doi/abs/10.1145/1830483.1830557 # # Title: Natural Evolution Strategies (SeparableNES) diff --git a/tests/test_single_objective_algorithms.py b/tests/test_single_objective_algorithms.py index 8dc396ab..1bd3311b 100644 --- a/tests/test_single_objective_algorithms.py +++ b/tests/test_single_objective_algorithms.py @@ -2,7 +2,7 @@ import jax.numpy as jnp import pytest from evox import pipelines, problems -from evox.algorithms import CMAES, SepCMAES, CSO, DE, PGPE, PSO, OpenES, xNES, CoDE, JaDE, SaDE, SHADE +from evox.algorithms import CMAES, SepCMAES, CSO, DE, PGPE, PSO, OpenES, XNES, CoDE, JaDE, SaDE, SHADE from evox.monitors import StdSOMonitor from evox.utils import compose, rank_based_fitness @@ -98,7 +98,7 @@ def test_openes(optimizer): def test_xnes(): init_mean = jnp.array([5.0, -10, 15, -20, 25]) init_covar = jnp.eye(5) * 2 - algorithm = xNES(init_mean, init_covar, pop_size=100) + algorithm = XNES(init_mean, init_covar, pop_size=100) fitness = run_single_objective_algorithm(algorithm) assert fitness < 0.1