nomuramasahir0 / crfmnes

(CEC2022) Fast Moving Natural Evolution Strategy for High-Dimensional Problems
https://arxiv.org/abs/2201.11422
MIT License
16 stars 1 forks source link

Recommend to add assertion for the value of "lamb" in CRFMNES init #5

Closed nhansendev closed 1 year ago

nhansendev commented 1 year ago

I've noticed that if "lamb" is defined as an odd number it will result in a ValueError as it tries to split data unevenly (except for "3", which mysteriously works just fine).

My suggestion is to add this line to the CRFMNES init:

assert (lamb > 0 and lamb % 2 == 0), f"The value of 'lamb' must be an even, positive integer greater than 0"
nomuramasahir0 commented 1 year ago

Thank you for the suggestion! Yes, CR-FM-NES uses even number for lambda because it uses antithetic variates method, which reduces the variance of estimating natural gradient. I accept the suggestion and will fix this later.

nomuramasahir0 commented 1 year ago

Fixed. Thanks @Obliman!