nnaisense / evotorch

Advanced evolutionary computation library built directly on top of PyTorch, created at NNAISENSE.
https://evotorch.ai
Apache License 2.0
997 stars 62 forks source link

cma initialization problem #85

Closed haohaomiao closed 11 months ago

haohaomiao commented 1 year ago

When I am using CMAES searcher, the following problem occurs:

Traceback (most recent call last):
  File "/Users/haohaomiao/codefields/EvoTorch/test.py", line 11, in <module>
    searcher = CMAES(problem, stdev_init = 10)
  File "/Users/haohaomiao/anaconda3/envs/EvoTorch/lib/python3.10/site-packages/evotorch/algorithms/cmaes.py", line 365, in __init__
    self.decompose_C_freq = max(1, int(1 / np.floor(10 * d * (self.c_1.cpu() + self.c_mu.cpu()))))
OverflowError: cannot convert float infinity to integer

The dimension of my problem is 1000. 1000 is not a big number so maybe an improvement is needed.

engintoklu commented 1 year ago

Hello @haohaomiao ! Thank you very much for your very helpful feedback! There is now a pull request (#86) addressing the issue #76 and also this issue you raised.