Skip to content

Nevergrad: OnePlusOne Optimiser addition #576

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

Merged
merged 20 commits into from
Jul 19, 2025
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
f92fd3f
Inspiration from merged commit
gulshan-123 May 6, 2025
7c9e0ab
changed bound setting method to avoid nan and inf
gulshan-123 May 6, 2025
940f18f
Mutation added to avoid looking at inf, some parameter tuning
gulshan-123 May 6, 2025
2238658
Merge branch 'main' into nevergrad-OneplusOne
gauravmanmode May 23, 2025
80c7e63
is global=true and default gaussian
gulshan-123 May 25, 2025
4fd75fe
Finalise documentation with suggestions fixed
gulshan-123 May 25, 2025
b662d8c
added docs clarification and improve typehinting
gulshan-123 May 26, 2025
95a671c
Update algorithms.md
gauravmanmode Jun 23, 2025
d263653
Move documentation to docstring and fixes
gauravmanmode Jun 23, 2025
7395742
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 23, 2025
91110f5
Update refs.bib
gauravmanmode Jun 23, 2025
e695910
Update nevergrad_optimizers.py
gauravmanmode Jun 23, 2025
89d760f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 23, 2025
91540a7
Merge branch 'main' into nevergrad-OneplusOne
janosg Jun 30, 2025
4c9d284
support both None and "none"
gauravmanmode Jul 2, 2025
cde3030
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 2, 2025
b08d370
Update nevergrad_optimizers.py
gauravmanmode Jul 2, 2025
1cc28ed
Merge branch 'main' into nevergrad-OneplusOne
gauravmanmode Jul 9, 2025
710bba9
Merge branch 'main' into nevergrad-OneplusOne
gauravmanmode Jul 19, 2025
e7619bc
add decorator fields, move docstring to docs
gauravmanmode Jul 19, 2025
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
43 changes: 43 additions & 0 deletions docs/source/refs.bib
Original file line number Diff line number Diff line change
Expand Up @@ -927,4 +927,47 @@ @InProceedings{Zambrano2013
doi = {10.1109/CEC.2013.6557848},
}

@book{Rechenberg1973,
author = {Rechenberg, Ingo},
title = {Evolutionsstrategie: Optimierung technischer Systeme nach Prinzipien der biologischen Evolution},
publisher = {Frommann-Holzboog Verlag},
year = {1973},
url = {https://gwern.net/doc/reinforcement-learning/exploration/1973-rechenberg.pdf},
address = {Stuttgart},
note = {[Evolution Strategy: Optimization of Technical Systems According to the Principles of Biological Evolution]}
}

@article{Schumer1968,
author={Schumer, M. and Steiglitz, K.},
journal={IEEE Transactions on Automatic Control},
title={Adaptive step size random search},
year={1968},
volume={13},
number={3},
pages={270-276},
keywords={Minimization methods;Gradient methods;Search methods;Adaptive control;Communication systems;Q measurement;Cost function;Newton method;Military computing},
doi={10.1109/TAC.1968.1098903}
}

@misc{doerr2017,
title={Fast Genetic Algorithms},
author={Benjamin Doerr and Huu Phuoc Le and Régis Makhmara and Ta Duy Nguyen},
year={2017},
eprint={1703.03334},
archivePrefix={arXiv},
primaryClass={cs.NE},
url={https://arxiv.org/abs/1703.03334},
}

@misc{dang2016,
title={Self-adaptation of Mutation Rates in Non-elitist Populations},
author={Duc-Cuong Dang and Per Kristian Lehre},
year={2016},
eprint={1606.05551},
archivePrefix={arXiv},
primaryClass={cs.NE},
url={https://arxiv.org/abs/1606.05551},
}


@Comment{jabref-meta: databaseType:bibtex;}
34 changes: 33 additions & 1 deletion src/optimagic/algorithms.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from optimagic.optimizers.ipopt import Ipopt
from optimagic.optimizers.nag_optimizers import NagDFOLS, NagPyBOBYQA
from optimagic.optimizers.neldermead import NelderMeadParallel
from optimagic.optimizers.nevergrad_optimizers import NevergradPSO
from optimagic.optimizers.nevergrad_optimizers import NevergradOnePlusOne, NevergradPSO
from optimagic.optimizers.nlopt_optimizers import (
NloptBOBYQA,
NloptCCSAQ,
Expand Down Expand Up @@ -172,6 +172,7 @@ def Scalar(

@dataclass(frozen=True)
class BoundedGlobalGradientFreeParallelScalarAlgorithms(AlgoSelection):
nevergrad_oneplusone: Type[NevergradOnePlusOne] = NevergradOnePlusOne
nevergrad_pso: Type[NevergradPSO] = NevergradPSO
pygmo_gaco: Type[PygmoGaco] = PygmoGaco
pygmo_pso_gen: Type[PygmoPsoGen] = PygmoPsoGen
Expand Down Expand Up @@ -366,6 +367,7 @@ def Scalar(self) -> BoundedGlobalGradientFreeNonlinearConstrainedScalarAlgorithm

@dataclass(frozen=True)
class BoundedGlobalGradientFreeScalarAlgorithms(AlgoSelection):
nevergrad_oneplusone: Type[NevergradOnePlusOne] = NevergradOnePlusOne
nevergrad_pso: Type[NevergradPSO] = NevergradPSO
nlopt_crs2_lm: Type[NloptCRS2LM] = NloptCRS2LM
nlopt_direct: Type[NloptDirect] = NloptDirect
Expand Down Expand Up @@ -406,6 +408,7 @@ def Parallel(self) -> BoundedGlobalGradientFreeParallelScalarAlgorithms:

@dataclass(frozen=True)
class BoundedGlobalGradientFreeParallelAlgorithms(AlgoSelection):
nevergrad_oneplusone: Type[NevergradOnePlusOne] = NevergradOnePlusOne
nevergrad_pso: Type[NevergradPSO] = NevergradPSO
pygmo_gaco: Type[PygmoGaco] = PygmoGaco
pygmo_pso_gen: Type[PygmoPsoGen] = PygmoPsoGen
Expand Down Expand Up @@ -462,6 +465,7 @@ def Scalar(self) -> GlobalGradientFreeNonlinearConstrainedParallelScalarAlgorith

@dataclass(frozen=True)
class GlobalGradientFreeParallelScalarAlgorithms(AlgoSelection):
nevergrad_oneplusone: Type[NevergradOnePlusOne] = NevergradOnePlusOne
nevergrad_pso: Type[NevergradPSO] = NevergradPSO
pygmo_gaco: Type[PygmoGaco] = PygmoGaco
pygmo_pso_gen: Type[PygmoPsoGen] = PygmoPsoGen
Expand Down Expand Up @@ -610,6 +614,7 @@ def Scalar(self) -> BoundedGradientFreeNonlinearConstrainedParallelScalarAlgorit

@dataclass(frozen=True)
class BoundedGradientFreeParallelScalarAlgorithms(AlgoSelection):
nevergrad_oneplusone: Type[NevergradOnePlusOne] = NevergradOnePlusOne
nevergrad_pso: Type[NevergradPSO] = NevergradPSO
pygmo_gaco: Type[PygmoGaco] = PygmoGaco
pygmo_pso_gen: Type[PygmoPsoGen] = PygmoPsoGen
Expand Down Expand Up @@ -705,6 +710,7 @@ def Scalar(self) -> BoundedGlobalNonlinearConstrainedParallelScalarAlgorithms:

@dataclass(frozen=True)
class BoundedGlobalParallelScalarAlgorithms(AlgoSelection):
nevergrad_oneplusone: Type[NevergradOnePlusOne] = NevergradOnePlusOne
nevergrad_pso: Type[NevergradPSO] = NevergradPSO
pygmo_gaco: Type[PygmoGaco] = PygmoGaco
pygmo_pso_gen: Type[PygmoPsoGen] = PygmoPsoGen
Expand Down Expand Up @@ -1032,6 +1038,7 @@ def Local(self) -> GradientBasedLocalNonlinearConstrainedScalarAlgorithms:

@dataclass(frozen=True)
class BoundedGlobalGradientFreeAlgorithms(AlgoSelection):
nevergrad_oneplusone: Type[NevergradOnePlusOne] = NevergradOnePlusOne
nevergrad_pso: Type[NevergradPSO] = NevergradPSO
nlopt_crs2_lm: Type[NloptCRS2LM] = NloptCRS2LM
nlopt_direct: Type[NloptDirect] = NloptDirect
Expand Down Expand Up @@ -1096,6 +1103,7 @@ def Scalar(self) -> GlobalGradientFreeNonlinearConstrainedScalarAlgorithms:

@dataclass(frozen=True)
class GlobalGradientFreeScalarAlgorithms(AlgoSelection):
nevergrad_oneplusone: Type[NevergradOnePlusOne] = NevergradOnePlusOne
nevergrad_pso: Type[NevergradPSO] = NevergradPSO
nlopt_crs2_lm: Type[NloptCRS2LM] = NloptCRS2LM
nlopt_direct: Type[NloptDirect] = NloptDirect
Expand Down Expand Up @@ -1140,6 +1148,7 @@ def Parallel(self) -> GlobalGradientFreeParallelScalarAlgorithms:

@dataclass(frozen=True)
class GlobalGradientFreeParallelAlgorithms(AlgoSelection):
nevergrad_oneplusone: Type[NevergradOnePlusOne] = NevergradOnePlusOne
nevergrad_pso: Type[NevergradPSO] = NevergradPSO
pygmo_gaco: Type[PygmoGaco] = PygmoGaco
pygmo_pso_gen: Type[PygmoPsoGen] = PygmoPsoGen
Expand Down Expand Up @@ -1306,6 +1315,7 @@ def Scalar(self) -> BoundedGradientFreeNonlinearConstrainedScalarAlgorithms:
@dataclass(frozen=True)
class BoundedGradientFreeScalarAlgorithms(AlgoSelection):
nag_pybobyqa: Type[NagPyBOBYQA] = NagPyBOBYQA
nevergrad_oneplusone: Type[NevergradOnePlusOne] = NevergradOnePlusOne
nevergrad_pso: Type[NevergradPSO] = NevergradPSO
nlopt_bobyqa: Type[NloptBOBYQA] = NloptBOBYQA
nlopt_cobyla: Type[NloptCOBYLA] = NloptCOBYLA
Expand Down Expand Up @@ -1378,6 +1388,7 @@ def Parallel(self) -> BoundedGradientFreeLeastSquaresParallelAlgorithms:

@dataclass(frozen=True)
class BoundedGradientFreeParallelAlgorithms(AlgoSelection):
nevergrad_oneplusone: Type[NevergradOnePlusOne] = NevergradOnePlusOne
nevergrad_pso: Type[NevergradPSO] = NevergradPSO
pounders: Type[Pounders] = Pounders
pygmo_gaco: Type[PygmoGaco] = PygmoGaco
Expand Down Expand Up @@ -1460,6 +1471,7 @@ def Scalar(self) -> GradientFreeNonlinearConstrainedParallelScalarAlgorithms:
@dataclass(frozen=True)
class GradientFreeParallelScalarAlgorithms(AlgoSelection):
neldermead_parallel: Type[NelderMeadParallel] = NelderMeadParallel
nevergrad_oneplusone: Type[NevergradOnePlusOne] = NevergradOnePlusOne
nevergrad_pso: Type[NevergradPSO] = NevergradPSO
pygmo_gaco: Type[PygmoGaco] = PygmoGaco
pygmo_pso_gen: Type[PygmoPsoGen] = PygmoPsoGen
Expand Down Expand Up @@ -1529,6 +1541,7 @@ def Scalar(self) -> BoundedGlobalNonlinearConstrainedScalarAlgorithms:

@dataclass(frozen=True)
class BoundedGlobalScalarAlgorithms(AlgoSelection):
nevergrad_oneplusone: Type[NevergradOnePlusOne] = NevergradOnePlusOne
nevergrad_pso: Type[NevergradPSO] = NevergradPSO
nlopt_crs2_lm: Type[NloptCRS2LM] = NloptCRS2LM
nlopt_direct: Type[NloptDirect] = NloptDirect
Expand Down Expand Up @@ -1578,6 +1591,7 @@ def Parallel(self) -> BoundedGlobalParallelScalarAlgorithms:

@dataclass(frozen=True)
class BoundedGlobalParallelAlgorithms(AlgoSelection):
nevergrad_oneplusone: Type[NevergradOnePlusOne] = NevergradOnePlusOne
nevergrad_pso: Type[NevergradPSO] = NevergradPSO
pygmo_gaco: Type[PygmoGaco] = PygmoGaco
pygmo_pso_gen: Type[PygmoPsoGen] = PygmoPsoGen
Expand Down Expand Up @@ -1647,6 +1661,7 @@ def Scalar(self) -> GlobalNonlinearConstrainedParallelScalarAlgorithms:

@dataclass(frozen=True)
class GlobalParallelScalarAlgorithms(AlgoSelection):
nevergrad_oneplusone: Type[NevergradOnePlusOne] = NevergradOnePlusOne
nevergrad_pso: Type[NevergradPSO] = NevergradPSO
pygmo_gaco: Type[PygmoGaco] = PygmoGaco
pygmo_pso_gen: Type[PygmoPsoGen] = PygmoPsoGen
Expand Down Expand Up @@ -1882,6 +1897,7 @@ def Scalar(self) -> BoundedNonlinearConstrainedParallelScalarAlgorithms:

@dataclass(frozen=True)
class BoundedParallelScalarAlgorithms(AlgoSelection):
nevergrad_oneplusone: Type[NevergradOnePlusOne] = NevergradOnePlusOne
nevergrad_pso: Type[NevergradPSO] = NevergradPSO
pygmo_gaco: Type[PygmoGaco] = PygmoGaco
pygmo_pso_gen: Type[PygmoPsoGen] = PygmoPsoGen
Expand Down Expand Up @@ -2141,6 +2157,7 @@ def Local(self) -> GradientBasedLikelihoodLocalAlgorithms:

@dataclass(frozen=True)
class GlobalGradientFreeAlgorithms(AlgoSelection):
nevergrad_oneplusone: Type[NevergradOnePlusOne] = NevergradOnePlusOne
nevergrad_pso: Type[NevergradPSO] = NevergradPSO
nlopt_crs2_lm: Type[NloptCRS2LM] = NloptCRS2LM
nlopt_direct: Type[NloptDirect] = NloptDirect
Expand Down Expand Up @@ -2229,6 +2246,7 @@ def Scalar(self) -> GradientFreeLocalScalarAlgorithms:
class BoundedGradientFreeAlgorithms(AlgoSelection):
nag_dfols: Type[NagDFOLS] = NagDFOLS
nag_pybobyqa: Type[NagPyBOBYQA] = NagPyBOBYQA
nevergrad_oneplusone: Type[NevergradOnePlusOne] = NevergradOnePlusOne
nevergrad_pso: Type[NevergradPSO] = NevergradPSO
nlopt_bobyqa: Type[NloptBOBYQA] = NloptBOBYQA
nlopt_cobyla: Type[NloptCOBYLA] = NloptCOBYLA
Expand Down Expand Up @@ -2326,6 +2344,7 @@ def Scalar(self) -> GradientFreeNonlinearConstrainedScalarAlgorithms:
class GradientFreeScalarAlgorithms(AlgoSelection):
nag_pybobyqa: Type[NagPyBOBYQA] = NagPyBOBYQA
neldermead_parallel: Type[NelderMeadParallel] = NelderMeadParallel
nevergrad_oneplusone: Type[NevergradOnePlusOne] = NevergradOnePlusOne
nevergrad_pso: Type[NevergradPSO] = NevergradPSO
nlopt_bobyqa: Type[NloptBOBYQA] = NloptBOBYQA
nlopt_cobyla: Type[NloptCOBYLA] = NloptCOBYLA
Expand Down Expand Up @@ -2407,6 +2426,7 @@ def Parallel(self) -> GradientFreeLeastSquaresParallelAlgorithms:
@dataclass(frozen=True)
class GradientFreeParallelAlgorithms(AlgoSelection):
neldermead_parallel: Type[NelderMeadParallel] = NelderMeadParallel
nevergrad_oneplusone: Type[NevergradOnePlusOne] = NevergradOnePlusOne
nevergrad_pso: Type[NevergradPSO] = NevergradPSO
pounders: Type[Pounders] = Pounders
pygmo_gaco: Type[PygmoGaco] = PygmoGaco
Expand Down Expand Up @@ -2447,6 +2467,7 @@ def Scalar(self) -> GradientFreeParallelScalarAlgorithms:

@dataclass(frozen=True)
class BoundedGlobalAlgorithms(AlgoSelection):
nevergrad_oneplusone: Type[NevergradOnePlusOne] = NevergradOnePlusOne
nevergrad_pso: Type[NevergradPSO] = NevergradPSO
nlopt_crs2_lm: Type[NloptCRS2LM] = NloptCRS2LM
nlopt_direct: Type[NloptDirect] = NloptDirect
Expand Down Expand Up @@ -2529,6 +2550,7 @@ def Scalar(self) -> GlobalNonlinearConstrainedScalarAlgorithms:

@dataclass(frozen=True)
class GlobalScalarAlgorithms(AlgoSelection):
nevergrad_oneplusone: Type[NevergradOnePlusOne] = NevergradOnePlusOne
nevergrad_pso: Type[NevergradPSO] = NevergradPSO
nlopt_crs2_lm: Type[NloptCRS2LM] = NloptCRS2LM
nlopt_direct: Type[NloptDirect] = NloptDirect
Expand Down Expand Up @@ -2582,6 +2604,7 @@ def Parallel(self) -> GlobalParallelScalarAlgorithms:

@dataclass(frozen=True)
class GlobalParallelAlgorithms(AlgoSelection):
nevergrad_oneplusone: Type[NevergradOnePlusOne] = NevergradOnePlusOne
nevergrad_pso: Type[NevergradPSO] = NevergradPSO
pygmo_gaco: Type[PygmoGaco] = PygmoGaco
pygmo_pso_gen: Type[PygmoPsoGen] = PygmoPsoGen
Expand Down Expand Up @@ -2847,6 +2870,7 @@ class BoundedScalarAlgorithms(AlgoSelection):
iminuit_migrad: Type[IminuitMigrad] = IminuitMigrad
ipopt: Type[Ipopt] = Ipopt
nag_pybobyqa: Type[NagPyBOBYQA] = NagPyBOBYQA
nevergrad_oneplusone: Type[NevergradOnePlusOne] = NevergradOnePlusOne
nevergrad_pso: Type[NevergradPSO] = NevergradPSO
nlopt_bobyqa: Type[NloptBOBYQA] = NloptBOBYQA
nlopt_ccsaq: Type[NloptCCSAQ] = NloptCCSAQ
Expand Down Expand Up @@ -2948,6 +2972,7 @@ def Parallel(self) -> BoundedLeastSquaresParallelAlgorithms:

@dataclass(frozen=True)
class BoundedParallelAlgorithms(AlgoSelection):
nevergrad_oneplusone: Type[NevergradOnePlusOne] = NevergradOnePlusOne
nevergrad_pso: Type[NevergradPSO] = NevergradPSO
pounders: Type[Pounders] = Pounders
pygmo_gaco: Type[PygmoGaco] = PygmoGaco
Expand Down Expand Up @@ -3050,6 +3075,7 @@ def Scalar(self) -> NonlinearConstrainedParallelScalarAlgorithms:
@dataclass(frozen=True)
class ParallelScalarAlgorithms(AlgoSelection):
neldermead_parallel: Type[NelderMeadParallel] = NelderMeadParallel
nevergrad_oneplusone: Type[NevergradOnePlusOne] = NevergradOnePlusOne
nevergrad_pso: Type[NevergradPSO] = NevergradPSO
pygmo_gaco: Type[PygmoGaco] = PygmoGaco
pygmo_pso_gen: Type[PygmoPsoGen] = PygmoPsoGen
Expand Down Expand Up @@ -3158,6 +3184,7 @@ class GradientFreeAlgorithms(AlgoSelection):
nag_dfols: Type[NagDFOLS] = NagDFOLS
nag_pybobyqa: Type[NagPyBOBYQA] = NagPyBOBYQA
neldermead_parallel: Type[NelderMeadParallel] = NelderMeadParallel
nevergrad_oneplusone: Type[NevergradOnePlusOne] = NevergradOnePlusOne
nevergrad_pso: Type[NevergradPSO] = NevergradPSO
nlopt_bobyqa: Type[NloptBOBYQA] = NloptBOBYQA
nlopt_cobyla: Type[NloptCOBYLA] = NloptCOBYLA
Expand Down Expand Up @@ -3229,6 +3256,7 @@ def Scalar(self) -> GradientFreeScalarAlgorithms:

@dataclass(frozen=True)
class GlobalAlgorithms(AlgoSelection):
nevergrad_oneplusone: Type[NevergradOnePlusOne] = NevergradOnePlusOne
nevergrad_pso: Type[NevergradPSO] = NevergradPSO
nlopt_crs2_lm: Type[NloptCRS2LM] = NloptCRS2LM
nlopt_direct: Type[NloptDirect] = NloptDirect
Expand Down Expand Up @@ -3363,6 +3391,7 @@ class BoundedAlgorithms(AlgoSelection):
ipopt: Type[Ipopt] = Ipopt
nag_dfols: Type[NagDFOLS] = NagDFOLS
nag_pybobyqa: Type[NagPyBOBYQA] = NagPyBOBYQA
nevergrad_oneplusone: Type[NevergradOnePlusOne] = NevergradOnePlusOne
nevergrad_pso: Type[NevergradPSO] = NevergradPSO
nlopt_bobyqa: Type[NloptBOBYQA] = NloptBOBYQA
nlopt_ccsaq: Type[NloptCCSAQ] = NloptCCSAQ
Expand Down Expand Up @@ -3500,6 +3529,7 @@ class ScalarAlgorithms(AlgoSelection):
ipopt: Type[Ipopt] = Ipopt
nag_pybobyqa: Type[NagPyBOBYQA] = NagPyBOBYQA
neldermead_parallel: Type[NelderMeadParallel] = NelderMeadParallel
nevergrad_oneplusone: Type[NevergradOnePlusOne] = NevergradOnePlusOne
nevergrad_pso: Type[NevergradPSO] = NevergradPSO
nlopt_bobyqa: Type[NloptBOBYQA] = NloptBOBYQA
nlopt_ccsaq: Type[NloptCCSAQ] = NloptCCSAQ
Expand Down Expand Up @@ -3629,6 +3659,7 @@ def Local(self) -> LikelihoodLocalAlgorithms:
@dataclass(frozen=True)
class ParallelAlgorithms(AlgoSelection):
neldermead_parallel: Type[NelderMeadParallel] = NelderMeadParallel
nevergrad_oneplusone: Type[NevergradOnePlusOne] = NevergradOnePlusOne
nevergrad_pso: Type[NevergradPSO] = NevergradPSO
pounders: Type[Pounders] = Pounders
pygmo_gaco: Type[PygmoGaco] = PygmoGaco
Expand Down Expand Up @@ -3678,6 +3709,7 @@ class Algorithms(AlgoSelection):
nag_dfols: Type[NagDFOLS] = NagDFOLS
nag_pybobyqa: Type[NagPyBOBYQA] = NagPyBOBYQA
neldermead_parallel: Type[NelderMeadParallel] = NelderMeadParallel
nevergrad_oneplusone: Type[NevergradOnePlusOne] = NevergradOnePlusOne
nevergrad_pso: Type[NevergradPSO] = NevergradPSO
nlopt_bobyqa: Type[NloptBOBYQA] = NloptBOBYQA
nlopt_ccsaq: Type[NloptCCSAQ] = NloptCCSAQ
Expand Down
Loading
Loading