Run the attached code with the specific problem, dimension, algorithm combination. (There are other combinations with the same issue.)
Observe the standard error output
Observed Results
add_evaluation in nevergrad/optimization/utils.py crashes with an OverflowError
From some investigation it appears the parameter values become extremely large/small, e.g. -6.52988354e+153 (and consequently the y values become inf or -inf?), resulting in a too large value when taking the square.
Main error output:
/.../venv/lib/python3.9/site-packages/sklearn/utils/extmath.py:152: RuntimeWarning: overflow encountered in matmul
ret = a @ b
/.../venv/lib/python3.9/site-packages/sklearn/utils/extmath.py:152: RuntimeWarning: invalid value encountered in matmul
ret = a @ b
/.../venv/lib/python3.9/site-packages/nevergrad/optimization/base.py:146: LossTooLargeWarning: Clipping very high value nan in tell (rescale the cost function?).
warnings.warn(msg, e)
Traceback (most recent call last):
File "/.../mwe.py", line 44, in <module>
run_algos(algorithm, problem, eval_budget, dimension, instance, seed)
File "/.../mwe.py", line 29, in run_algos
algorithm(function, seed)
File "/.../mwe.py", line 18, in __call__
optimizer.minimize(func)
File "/.../venv/lib/python3.9/site-packages/nevergrad/optimization/base.py", line 659, in minimize
args = self.ask()
File "/.../venv/lib/python3.9/site-packages/nevergrad/optimization/base.py", line 469, in ask
candidate = self._internal_ask_candidate()
File "/.../venv/lib/python3.9/site-packages/nevergrad/optimization/optimizerlib.py", line 1552, in _internal_ask_candidate
data = _learn_on_k_best(self.archive, sample_size)
File "/.../venv/lib/python3.9/site-packages/nevergrad/optimization/optimizerlib.py", line 1510, in _learn_on_k_best
minimum = optimizer.minimize(
File "/.../venv/lib/python3.9/site-packages/nevergrad/optimization/base.py", line 642, in minimize
self.tell(x, result)
File "/.../venv/lib/python3.9/site-packages/nevergrad/optimization/base.py", line 381, in tell
self._update_archive_and_bests(candidate, loss)
File "/.../venv/lib/python3.9/site-packages/nevergrad/optimization/base.py", line 412, in _update_archive_and_bests
mvalue.add_evaluation(loss)
File "/.../venv/lib/python3.9/site-packages/nevergrad/optimization/utils.py", line 82, in add_evaluation
self.square = max(self.square, self.mean ** 2)
OverflowError: (34, 'Numerical result out of range')
Relevant Code
The example below should reproduce the issue. For ioh==0.3.5 and nevergrad==0.5.0 with Python 3.9.5
Steps to reproduce
Observed Results
add_evaluation
innevergrad/optimization/utils.py
crashes with anOverflowError
-6.52988354e+153
(and consequently the y values becomeinf
or-inf
?), resulting in a too large value when taking the square.Relevant Code
The example below should reproduce the issue. For
ioh==0.3.5
andnevergrad==0.5.0
with Python 3.9.5