Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting precision for all calculations #10

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

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.

None yet

1 participant