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

get_candidate_x #214

Open
answerIII opened this issue Oct 5, 2020 · 1 comment
Open

get_candidate_x #214

answerIII opened this issue Oct 5, 2020 · 1 comment

Comments

@answerIII
Copy link

Hi! I am working with surrogate CMAES where parameters have boundaries 0 to 1 on Python (surrpcmaes_pwqb). When I try to return the candidate by the method get_candidate_x, it returns values out of range.

This situation is in several cases:
bcand = cmasols.best_candidate()
best_x = lcmaes.get_candidate_x(bcand)
or
def ncsurrfunc(self, c, m):
x = []
y = []
for ci in c:
x.append(lcmaes.get_candidate_x(ci))
y.append(ci.get_fvalue())
# nx = encode(x,m)
self.traindt(x, y)
For example, output from x.append(lcmaes.get_candidate_x(ci)):
[ 0.9738188 1.3144068 1.1626065 1.3041023 0.34624505 1.010639 0.7516571 0.7380347 0.90886545 1.177999 -0.17459498 -0.171487 0.41590154 0.9304276 -0.31608018 0.2693098 0.25694674 0.71747833 0.03769534 -0.41249585 0.09692293 0.0981518 0.15991642 1.3242306 0.6308082 1.2415276 1.022431 0.860485 0.52259076 0.6059855 0.3968408 -0.5575023 0.14020891 0.12876558 -0.15827467 0.4910336 0.66046447 0.44146934 -0.39034626 -0.46236753]

But in *.dat file CMAES and modifications of CMAES (sep, restart) store parameters correctly. I have fixed the first case by extracting best_candidate from this file. But how it could be fixed for the surrogate case?

@beniz
Copy link
Collaborator

beniz commented Oct 20, 2020

Hi, I believe you may need to get your cmasols from a pwq genopho, let me know if the code snippet in #146 (comment) helps.

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