CMA-ES / pycma

Python implementation of CMA-ES
Other
1.1k stars 178 forks source link

Motivation for boundary handler functions #237

Closed LamNgo1 closed 1 year ago

LamNgo1 commented 1 year ago

Hi,

Thank you for your great package. I have a question about the default boundary handler function. I see in the ask() method, after sampling the solutions from the normal distribution, the solutions are repaired by a function: https://github.com/CMA-ES/pycma/blob/6080396f5d90fee5e771ebf2814aebb069f90dde/cma/evolution_strategy.py#L2008-L2010 which uses BoxConstraintsLinQuadTransformation class by default. Is the purpose of this repair to make sure all sampled solutions are within the specified bounds? If so, could you tell me more about the motivation behind this transformation? If possible, could you share with me some documents (books, papers, etc.) discussing this idea?

Another question I would like to ask is that, would it be different if we use a truncated normal distribution sampler to sample to solutions, instead of doing the transformation?

Thank you in advance!

nikohansen commented 1 year ago

Is the purpose of this repair to make sure all sampled solutions are within the specified bounds?

yes

If so, could you tell me more about the motivation behind this transformation?

It's a smooth transformation that garanties the candidate solution to be within the bounds thereby in some way mirroring/repeating the landscape outside of the bounds. There is not much more to it.

If possible, could you share with me some documents (books, papers, etc.) discussing this idea?

The best source is probably the documentation of the code.

would it be different if we use a truncated normal distribution sampler to sample to solutions, instead of doing the transformation?

Yes, that's a very different boundary handling which often has a detrimental effect on step-size control because it violates the unbiasedness assumption of the sample distribution.