Closed RobertTLange closed 1 month ago
Furthermore, multiplying the fitness back with -1 doesn't change anything about the plot - this seems odd to me.
Hi, I guess the problem comes from the negative fitness. As you can see, the default optimizer is design for simple usage, so the fitness mapping is Identity
. However, our formulation is to map fitness to probability density, which is always positive number.
For this reason, I suggest you use the "typical usage" in the README.md
, which exposes all the components. Then, you can choose a better mapping, such as exp(-f), or 1/(f+eps), which ensures they are positive.
Thank you for the quick reply. Like I said using -fitness and just fitness gives the same results.
could you maybe share the settings you used for the rosenbrock task in the paper?
You can find them in the experiments/benchmark/
folder. The traditional methods experiments may not work, since we haven't relase the CMA-ES/PEPG code yet (soon!), but you can find our experiment on Rosenbrock.
We basically re-define the fitness function, mapping desired fitness to higher density. See here: https://github.com/Zhangyanbo/diffusion-evolution/blob/360b002bb600787953809a50be6887b5687e689d/experiments/benchmarks/benchmarks.py#L91
Also, I think the reason that -fitness has no difference is caused by the normalization. The new generation is weighted average of current population, i.e., $\sum w_i x_i / \sum w_i$, which is equal to $\sum -w_i x_i / \sum -w_i$ if you set $w_i=f_i$.
Again, thank you for the response. I get that part.
I am actually looking for the noise_scale and mapping settings. So basically everything I need to reproduce the Rosenbrock results given the code above. From what you shared it looks as if all results use the default settings?
Maybe the README
is a bit confusing, but I'm not suggesting use the highly packed version. The optimization code of rosenbrock is here:
https://github.com/Zhangyanbo/diffusion-evolution/blob/360b002bb600787953809a50be6887b5687e689d/experiments/benchmarks/diff_evo.py#L16-L45
So, you can see that we use get_obj
to get a rescaled version of the function, where 1 means target, and 0 mean bad solutions. You can do this directly for fitness function, but you can also do this during the loop (if you use the "typical usage").
Thank you, I got something somewhat working now. I think it would make a lot of sense to update the Readme/Defaults to something that is fairly robust across fitness landscapes.
Closing this.
Hi there,
I am trying to replicate some of the results to get a better feeling for scaling, etc. Using 512 popmembers for 2D tasks seems far too much.
And I can't get the method to work. Playing with a 2D rosenbrock (using
-1 * fitness
for minimization). I get the following diverging plot. Can you help out?I am running the following minimal extracted code: