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

Setting precision for all calculations #10

Open twoletters opened 1 year ago

twoletters commented 1 year ago

NumPy defaults to float64 on modern systems. It can sometimes be convenient to decrease precision to float32 to limit the memory footprint and speed up calculations, or to increase it to float128 for precise calculations. This PR used a few hacks to keep the code as clean as possible. Please double-check and test all calculations, as I reordered some elements and modified many.

Specifying a type is optional and can be achieved by adding parameter dtype to the CRFMNES constructor:

    cr = CRFMNES(dim, const_sphere, mean, sigma, lamb, dtype=np.float128)

For convenience, a Dockerfile and updated dependencies are also provided.