-
Notifications
You must be signed in to change notification settings - Fork 79
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
Bound and Scaling questions #195
Comments
It is a possible way, but I wouldn't expect any algorithm designed for continuous variables (as CMA-ES is) to work exceptionally or even reasonably well on binary variables out of the box.
It should, maybe it does? If not, the burden to keep the record is left to the user (it's not rocket science, only burdensome).
In general, bounds and the initial sigma(s) are on purpose seperate input variables that do not necessarily need to agree. The algorithm can be used to search the full space, but it can also be used to locally improve a provided initial solution even when bounds are given. The decision is up to the user based on the initial sigma(s). In the above case, either the problem should be re-scaled or different sigmas need to be given (I don't know by heart whether libcmaes provides this option). Specifically, it seems that in libcmaes sigma can be set to -1 (which I don't like very much, because it leads to an arbitrary decision in the unbounded case). In the bounded case and with sigma=-1, the sigma could indeed be chosen based on the given bounds, see e.g. here. |
During optimization, the function returns values smaller than the minimum found by libcmaes.
Something does not seem to be right… ?
in the code the sigma is only one double variable for all dimensions. Is it possible with libcmaes to give each dimension its own sigma? But with scaling, this might not be necessary...
greetings |
It's just the wrong return value in case of non-noisy functions, I guess. When the function is noisy it's not a good idea to return the solution that got the best value somewhere during the run. I can't speak to the other questions, as I am not intimately familiar with all interface options of libcmaes. |
Thanks, that's interesting! cmaes is still new to me. |
The analogy makes some sense, however it is not necessarily the most stable. Using the best-ever seen solution as attractor wouldn't stand necessarily in contradiction with stability, as any seen solution must have some positive attraction mass around it. Ignoring the best solution within the algorithm has conceptual (noisy fitness, unbiasedness) and technical (unbiasedness) reasons. The smaller the population size (or rather the parent number mu) and in particular the smaller sigma, the more likely it is to converge into the attraction basin of a single good evaluated solution. BTW, losing the attractor around the best solution is to my experience less likely to occur in larger dimension. |
Please see this bug - it explains what is happening: |
It does, use |
The API provides a way to specify a single sigma value. |
The bounds are fixed, see https://github.com/beniz/libcmaes/blob/7514782ebe7167c6a889173364c980874ac17b41/src/scaling.h#L147 and recommendations from this page apply: http://cma.gforge.inria.fr/cmaes_sourcecode_page.html#practical |
Hello and thanks, that is a wonderful library.
I would like to improve with cmaes the optimization time over bruteforce start/step/stop-scheme.
I work a lot with different types and bounds of values in the functions (bool, int, double). This library seems works with double so I round the double values to the data type before give them to the function. Is this the right way to deal with bool and integer Values?
But the important thing is this:
I did some basic tests with 2 dimensions (double):
I have bounds of:
Var1: 0.2 – 4.0
Var2: 20 – 400
For x0 I set the middle of the bounds. x0[i] = (Start+Stop) / 2;
code:
I log internally in the function all generated return values.
Graphs:
left graph = returnF (is displayed as a positive value! (*-1)),
middle graph = Var1,
right graph = Var2
Test: With BruteForce Start/Step/Stop-scheme (StepSize: Var1=0.1 / Var2=5)
Test: CMAES with sigma/lambda both = -1:
Test: CMAES with sigma/lambda both = 10:
My internal log shows that in the process, some return values are generated which are smaller than the best solution (f-value) by libcmaes. The graph shows smaller (displayed in graph as higher *-1) values during optimization as at the end. Why it does libcmaes not track the smallest value?
With auto sigma/lambda = -1 the bounds area are not fully utilized.
Why does the automatic setting not find (based of the bound) the sigmars that the bounds area full utilized?
greetings
The text was updated successfully, but these errors were encountered: