Difference between revisions of "Optimizer"

From SUMOwiki
Jump to navigationJump to search
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Optimizer ==
+
The SUMO Toolbox contains a whole hierarchy of optimizers that can be used by several components (for instance the [[Config:SampleSelector#expectedImprovement|EGO algorithm]] or the [[Config:AdaptiveModelBuilder#krigingoptim|OptimizerModelBuilder]]).
  
The SUMO Toolbox contains a whole hierarchy of optimizers that can be used by several components (for instance the [[SampleSelector#InfillSamplingCriterion| InfillSamplingCriterion]] or the [[Add Modeling Algorthm|Model Builder]]).
+
A list of available optimizers is found in <code>src/matlab/tools/Optimization/optimizers</code>. Note that some optimizers need some external code available in the extension pack (or the Matlab Optimization toolbox).
  
A list of available optimizers is found in <code>src/matlab/tools/Optimizer</code>.
+
A couple of '''example configurations''' are found [[Config:Optimizer|here]]. These tags can be used in supported components as stated above. When a particular option is not given a sane default will be used. Full information about the several options can be found in the optimizer source code, implementation and corresponding papers.
  
If you want to add a new optimizer please see [[Add a new optimizer]].
+
=== Add a custom optimizer ===
 +
In order to implement a new optimization algorithm one should only create one new class in <code>src/matlab/tools/Optimization/optimizers</code>. The class should be derived from the base class Optimizer and MUST implement at least the following functions:
 +
* A constructor accepting one parameter (the configuration xml tag) OR a varargin
 +
* [this, x, fval] = optimize(this, arg)
 +
** Accepts a function handle OR a SUMO model to optimize. x and fval are the resulting optimum(s) and associated function value(s).
 +
In addition the following methods COULD be implemented if appropriate:
 +
* size = getPopulationSize(this)
 +
** When implementing a population-based optimization algorithm
 +
* this = setInputConstraints( this, con )
 +
** When the algorithm supports constraints
 +
 
 +
It is advised to copy a simple existing optimizer and work from there. For example implementations, please see the provided optimizers. For instance, DifferentialEvolution is a good starting point. The optimizer can be used like:
 +
<source lang="xml">
 +
<Optimizer type="CLASSNAME">
 +
<Option key="option1" value="1" />
 +
<Option key="option2" value="2" />
 +
...
 +
</Optimizer>
 +
</source>

Latest revision as of 17:33, 30 January 2012

The SUMO Toolbox contains a whole hierarchy of optimizers that can be used by several components (for instance the EGO algorithm or the OptimizerModelBuilder).

A list of available optimizers is found in src/matlab/tools/Optimization/optimizers. Note that some optimizers need some external code available in the extension pack (or the Matlab Optimization toolbox).

A couple of example configurations are found here. These tags can be used in supported components as stated above. When a particular option is not given a sane default will be used. Full information about the several options can be found in the optimizer source code, implementation and corresponding papers.

Add a custom optimizer

In order to implement a new optimization algorithm one should only create one new class in src/matlab/tools/Optimization/optimizers. The class should be derived from the base class Optimizer and MUST implement at least the following functions:

  • A constructor accepting one parameter (the configuration xml tag) OR a varargin
  • [this, x, fval] = optimize(this, arg)
    • Accepts a function handle OR a SUMO model to optimize. x and fval are the resulting optimum(s) and associated function value(s).

In addition the following methods COULD be implemented if appropriate:

  • size = getPopulationSize(this)
    • When implementing a population-based optimization algorithm
  • this = setInputConstraints( this, con )
    • When the algorithm supports constraints

It is advised to copy a simple existing optimizer and work from there. For example implementations, please see the provided optimizers. For instance, DifferentialEvolution is a good starting point. The optimizer can be used like:

<Optimizer type="CLASSNAME">
	<Option key="option1" value="1" />
	<Option key="option2" value="2" />
	...
</Optimizer>