crfmnes icon indicating copy to clipboard operation
crfmnes copied to clipboard

Setting precision for all calculations

Open twoletters opened this issue 3 years ago • 0 comments

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.

twoletters avatar Jan 26 '23 18:01 twoletters