Open lunjohnzhang opened 9 months ago
Hi @lunjohnzhang, thank you for the suggestions! I can confirm that I am able to reproduce the behavior. This seems somewhere between a bug report and a feature request.
The new behavior seems reasonable, but I'm not sure what the API should be for it. Perhaps there could be a bounds_iters
parameter to CMAEvolutionStrategy.__init__
that is used in ask
as part of the behavior you describe? bounds_iters
could default to None
to indicate the behavior should not be activated. If someone wants the behavior, they can pass bounds_iters
in the es_kwargs
of EvolutionStrategyEmitter
.
Would you be willing to write a PR for this? No worries if not; I can always circle back to it later.
Thanks for the reply! The solution with bounds_iters
makes sense to me and I will be happy to write a PR for it. I guess you would want this feature in other ES as well?
Yes, that would be great. Thanks!
Description
I am trying to use
EvolutionStrategyEmitter
withCMAEvolutionStrategy
to generate high dimensional solutions (i.e. > 3000) where all dimensions are within the bounds[1e-3, None]
(i.e. larger than a small positive number). However, since the current implementation ofCMAEvolutionStrategy
simply keeps resampling until all solutions are within the bounds, it ends up iterating forever with high dimensional solutions (in theory it'll eventually sample solutions within the bounds but it's taking too long).Would it be possible to change the implementation such that it only resamples for a fixed number of iterations and clip the solution within the bounds after that?
Steps to Reproduce
The following code reproduce the above issue:
To reproduce the issue, run with
python <script_name> 3000 42
.