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

[Newbie ] How to use recommend #18

Open
lesshaste opened this issue Mar 6, 2022 · 1 comment
Open

[Newbie ] How to use recommend #18

lesshaste opened this issue Mar 6, 2022 · 1 comment

Comments

@lesshaste
Copy link

lesshaste commented Mar 6, 2022

Thank you for writing humpday, it looks amazing. I tried out the following:

from math import cos, pi
def rastrigin(a, b):
    A = 10
    n = 2
    value = -(A*n + sum([(x**2 - A*cos(2*pi*x)) for x in (a,b)]))
    return value

from humpday import recommend
def my_objective(u):
    return rastrigin(u[0], u[1])
recommendations = recommend(my_objective, n_dim=2, n_trials=1000)

recommendations now gives me [(None, None, 'scipy_powell_cube')]

However using lipo, for example, which I think is included with !pip install humpday[full] the function can be efficiently optimized.

What am I doing wrong?

@microprediction
Copy link
Owner

Try

pip install humpday[full]

or manually pip install lots of optimizers. It's probably only got scipy to use right now.

Let me know how it goes I'll fix it if broken.

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

2 participants