|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfr.inria.optimization.cmaes.CMAParameters
public class CMAParameters
Interface to strategy parameters for the CMA Evolution
Strategy, most importantly the population size lambda, while the change
of other parameters is discouraged.
The class CMAParameters processes the
strategy parameters, like population size and learning rates, for
the class CMAEvolutionStrategy
where the public field parameters
of
type CMAParameters
can
be used to set the parameter values. The method supplementRemainders(int, CMAOptions)
supplements those parameters that were not explicitly given,
regarding dependencies
(eg, the parent number, mu, cannot be larger than the
population size lambda) and does a respective consistency checking via method
check()
.
Parameters cannot be changed after CMAEvolutionStrategy method init()
was called.
Example code snippet:
CMAEvolutionStrategy cma = new CMAEvolutionStrategy(); cma.parameters.setPopulationSize(33); // set lambda int mu = cma.parameters.getMu(); // will fail as mu was not set and missing // parameters were not supplemented yet cma.readProperties(); // read necessary initial values, might overwrite lambda mu = cma.parameters.getMu(); // might still fail cma.init(); // finalize initialization, supplement missing parameters mu = cma.parameters.getMu(); // OK now cma.parameters.setMu(4); // runtime error, parameters cannot be changed after init()
Most commonly, the offspring population size lambda can be changed (increased) from its default value via setPopulationSize to improve the global search capability, see file CMAExample2.java. It is recommended to use the default values first!
CMAEvolutionStrategy.readProperties()
,
Serialized FormNested Class Summary | |
---|---|
static class |
CMAParameters.RecombinationType
|
Constructor Summary | |
---|---|
CMAParameters()
|
Method Summary | |
---|---|
java.lang.String |
check()
Checks strategy parameter setting with respect to principle consistency. |
double |
getCc()
Getter for backward time horizon parameter cc for distribution cumulation (for evolution path pc). |
double |
getCcov()
Getter for property covariance matrix learning rate ccov |
double |
getCcov(boolean flgdiag)
Getter for property covariance matrix learning rate ccov |
double |
getCs()
Getter for cs, parameter for the backward time horizon for the cumulation for sigma. |
double |
getDamps()
Getter for step-size damping damps. |
CMAParameters |
getDefaults(int N)
get default parameter setting depending on given dimension N |
CMAParameters |
getDefaults(int N,
int lambda)
get default parameter setting depending on dimension N and population size lambda. |
int |
getLambda()
Getter for offspring population size lambda, no check, whether lambda was already set properly |
int |
getMu()
Getter for property mu. |
double |
getMucov()
Getter for property mucov. |
double |
getMueff()
Getter for property mueff, the "variance effective selection mass". |
int |
getPopulationSize()
|
double[] |
getWeights()
Getter for property weights. |
void |
setCc(double cc)
Setter for cc to default value. |
void |
setCcov(double ccov)
Setter for covariance matrix learning rate ccov. |
void |
setCs(double cs)
Setter for cs to default value. |
void |
setDamps(double damps)
Setter for damps. |
void |
setMu(int mu)
Setter for parent number mu, be aware of the recombinationType when setting mu |
void |
setMucov(double mucov)
Setter for mucov. |
void |
setPopulationSize(int lambda)
Setter for offspring population size (lambda). |
void |
setRecombination(int mu,
CMAParameters.RecombinationType recombinationType)
Sets parent number mu and the policy for choosing the recombination weights. |
void |
setRecombinationWeights(CMAParameters.RecombinationType recombinationType)
Recombination weights can be equal, linearly decreasing, or super-linearly decreasing (default). |
void |
supplementRemainders(int N,
CMAOptions opts)
Supplements all default parameter values that were not explicitly set already. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CMAParameters()
Method Detail |
---|
public java.lang.String check()
public CMAParameters getDefaults(int N)
N
- dimension
getDefaults(int, int)
public CMAParameters getDefaults(int N, int lambda)
int default_mu_for_dimension_42 = new CMAParameters().getDefaults(42).getMu(); CMAEvolutionStrategy cma = new CMAEvolutionStrategy(42); int the_same_most_convenient = cma.getParameterDefaults().getMu(); int also_the_same = cma.getParameterDefaults(42).getMu();
N
- lambda
-
getDefaults(int, int)
public void supplementRemainders(int N, CMAOptions opts)
N
- search space dimensionopts
- CMAOptions
where stopMaxFunEvals and
stopMaxIter are used to set step-size damping parameter damps. This is of minor relevance.public int getMu()
public void setMu(int mu)
mu
- New value for the number of parents mu.setRecombination(int, CMAParameters.RecombinationType)
,
setRecombinationWeights(CMAParameters.RecombinationType)
public int getLambda()
public int getPopulationSize()
getLambda()
public void setPopulationSize(int lambda)
lambda
- is the offspring population sizepublic double[] getWeights()
public void setRecombinationWeights(CMAParameters.RecombinationType recombinationType)
recombinationType
- setRecombination(int, fr.inria.optimization.cmaes.CMAParameters.RecombinationType)
,
setMu(int)
public void setRecombination(int mu, CMAParameters.RecombinationType recombinationType)
mu
- recombinationType
- public double getMueff()
public double getMucov()
public void setMucov(double mucov)
mucov
- New value of mucov.getMucov()
public double getCcov(boolean flgdiag)
flgdiag
- boolean, true for getting the learning rate when
only the diagonal of the covariance matrix is updated
public double getCcov()
public void setCcov(double ccov)
ccov
- New value of property ccov.getCcov()
public double getDamps()
public void setDamps(double damps)
damps
- New value of damps.getDamps()
public double getCc()
public void setCc(double cc)
public double getCs()
public void setCs(double cs)
getCs()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |