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

C++ algorithms return None on Windows #23

Open
NominHanggai opened this issue Apr 4, 2024 · 2 comments
Open

C++ algorithms return None on Windows #23

NominHanggai opened this issue Apr 4, 2024 · 2 comments

Comments

@NominHanggai
Copy link

NominHanggai commented Apr 4, 2024

Hi Dietmar,

I installed fast-cma-es on Windows 11 following the instructions in README (X64 C++ runtime libraries were also installed).
Tried a small optimization:

import numpy as np
from scipy.optimize import Bounds
from fcmaes import cmaescpp, cmaes


def obj(x):
    return np.sum(x**2)

bounds = Bounds([-1, -1], [1, 1])
result = cmaescpp.minimize(obj, bounds)
print(result)

and got the following result:

 success: False
  status: -1
     fun: 1.7976931348623157e+308
       x: None
     nit: 0
    nfev: 0

The python algorithm works (cmaes). Output:

 success: True
  status: 4
     fun: 3.7194596397089263e-19
       x: [ 5.707e-10 -2.152e-10]
     nit: 78
    nfev: 1209

What do you think could be the cause? Thanks :)

@andrea-tango
Copy link

Dear all,

I am also facing the same issue on Ubuntu!

The Python algorithm works (cmaes) while the cpp version returns None.
Can you please help me?

Thank you in advance.

Best,
Andrea

@dietmarwo
Copy link
Owner

dietmarwo commented Nov 12, 2024

Please update to 1.6.11
pip install fcmaes --upgrade

I checked under Windows 10 and Linux Mint 21.3 using miniforge https://github.com/conda-forge/miniforge with python 10
and cannot reproduce the issue. If you can still can reproduce with 1.6.11 please provide more details about your environment.

I get:

success: True
status: 4
fun: 4.04350308835685e-15
x: [ 1.826e-08 6.091e-08]
nit: 31
nfev: 961

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

No branches or pull requests

3 participants