CMA-ES / pycma

Python implementation of CMA-ES

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

facing issue in using scaling_of_variables cma es for my problem.

pramodiisc opened this issue · comments

I am having a function f(x1,x2,x3,x4,x5,x6) that has to be minimised for the variable x1,x2,x3,x4,x5,x6. The range for the variables or the search domain is
x1 (300 to 1500),
x2 (0-10),
x3 (300 to 1500),
x4(0-10) ,
x5 (500 to 20000),
x6 (0-200)
which means the algo should search for variable falling in this range.

I am getting the function value from a simulator.

help(cma.fitness_transformations.ScaleCoordinates) is not clear to me how can I use it for my problem.

sigma0
scalar, initial standard deviation in each coordinate. sigma0 should be about 1/4th of the search domain width (where the optimum is to be expected). The variables in objective_function should be scaled such that they presumably have similar sensitivity. See also option scaling_of_variables.

if I am not usingcaleCoordinates I can not use sigma 0 bigger than 10 (x4(0-10) ) which is making the algo not searching in wider domain.

Can you please share or show any simpler example.

One typical approach is to scale the variables such that the above domain is sent to the interval [0, 1] in each variable (e.g. with ScaleCoordinates, for the first variable we would put multipliers = 1200, zero = -300/1200 such that 0 -> multipliers * (0 - zero) = 300 and 1 -> multipliers * (1 - zero) = 1500), however see also these practical hints. After that, the search should be bounded to the domain [0,1]. Example code to pass domain boundaries is given in the basic use cases notebook under Options and Bound Constraints.

This example suggests though that ScaleCoordinates could be implemented with a more user friendly interface: it should better return multipliers * x + zero, or it could accept lower and upper coordinate values to which 0 and 1 should map to, respectively, which would then be lower = zero and upper = zero + multipliers or equivalently upper - lower = multipliers.

Addressed with commit 5ac2a14