Skip to content

Setting precision for all calculations#10

Open
twoletters wants to merge 3 commits intonomuramasahir0:masterfrom
twoletters:master
Open

Setting precision for all calculations#10
twoletters wants to merge 3 commits intonomuramasahir0:masterfrom
twoletters:master

Conversation

@twoletters
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant