-
Notifications
You must be signed in to change notification settings - Fork 81
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
CMASolutions reports best candidate's x value incorrect #231
Comments
I found a suggestion in other issues saying we needed to use cmasols.get_best_seen_candidate() instead of cmasols.best_candidate()
Unfortunately, I still see incorrect answers in outputs.. Just see below that x should never be lower than 0.
Here is an other incorrect output.. x should never be higher than 21.
Please note that the issue happened less frequently than the first test, but still the same issue. |
Hi, see https://github.com/CMA-ES/libcmaes/wiki/Defining-and-using-bounds-on-parameters |
Thank you for the quick clarification. Transformation solved my issue. However, cmasols.print(...) implementation you mentioned uses the best_candidate() for report
The documentation suggests using best_seen_candidate(), which is confusing.
In this case, anyone who uses cmasols.print(...) might not see the best parameters. What is the exact difference between best_candidate() and best_seen_candidate()? Can we document the diff? |
You should be able to apply Maybe we should provide a |
Hi! Same problem here.
How do I get correct It would be nice to provide |
Hello @mirai-computing the |
Thanks, this clears things up a bit. |
Now there's another problem. When I instantiate
with
I've came across this issue earlier and I thought I've been calling wrong constructor since switching to one that allowed for anisotropic distribution with different sigmas (that were equal but came in a vector) fixed the issue. Looking at CMAParamters sources I see there's more ways to pass parameters to the upper class but I'm not sure if this configuration I need (with both vector sigma and gp) makes sense to CMA-ES. |
Update: here's the call stack inside libcmaes and Eigen when the assert fails:
|
This looks like a problem at the interface with Eigen library.
Then linScalingStrategy (libcmaes/scaling.h) tries to subtract two vectors
And here Eigen fails since for some reason
Any ideas? |
Update: debug print shows that |
Aren't you missing the https://github.com/CMA-ES/libcmaes/wiki/Defining-and-using-bounds-on-parameters |
Since I'm passing Then I wonder how is the dimension of problem determined when |
And no, this doesn't help. I switched call to |
p.s. this worked perfectly without |
OK, I kind of solved it.
Since there's no default |
Great, perseverance always pays :)
I'm not too young either :) When I wrote libcmaes I was pushing policy-based design as much as I could. I don't regret it, and this type of design, that avoids many pointer stuff and errors at runtime, has stayed with me until today. However, I did push it a bit too much in libcmaes, making the C++ API a bit difficult to use. That being said, it's been pretty stable over years, and I like having a function optimizer running on safe grounds, controled memory, etc.. as offered by policy-based templates! |
Well, you're cool and libcmaes is great :) I do understand why it is created in this way and I appreciate it, my only complaint up till now is that it is hard to debug things when almost everything important happens during static initialization in constructors ;>.<; I'm trying to marry CMA-ES in shape of libcmaes implementation to a SR (symbolic regression) implementation as a more of less universal solver for free parameters and I must say it converges pretty well and fast at least in not too complicated cases. So, I confirm you did a great job. |
Hello,
I found that the CMASolutions does not report best candidate's x value properly.
Here is an example output from 20 iteration:
I validated that x values in fitness function never gets higher than 21 during simulations, which is expected. You can see some of the x values are over 21. Sometimes I see negative x values too, which is also NOT expected.
Here is the test code I used:
Is this expected behavior? If yes then why?
I compiled the lib with OpenMP=OFF
I use v0.10 and built it from the source code.
Thanks
The text was updated successfully, but these errors were encountered: