public class NelderMead extends Object implements Optimizer
Constructor and Description |
---|
NelderMead() |
Modifier and Type | Method and Description |
---|---|
Vec |
optimize(double eps,
int iterationLimit,
Function f,
Function fd,
Vec vars,
List<Vec> inputs,
Vec outputs)
Performs optimization on the given inputs to find the minima of the function.
|
Vec |
optimize(double eps,
int iterationLimit,
Function f,
Function fd,
Vec vars,
List<Vec> inputs,
Vec outputs,
ExecutorService threadpool)
Performs optimization on the given inputs to find the minima of the function.
|
Vec |
optimize(double eps,
int iterationLimit,
Function f,
List<Vec> initalPoints)
Attempts to find the minimal value of the given function.
|
void |
setContraction(double contraction)
Sets the contraction constant, which must be in the range (0, 1)
|
void |
setExpansion(double expansion)
Sets the expansion constant, which must be greater than 1 and the reflection constant
|
void |
setReflection(double reflection)
Sets the reflection constant, which must be greater than 0
|
void |
setShrink(double shrink)
Sets the shrinkage constant, which must be in the range (0, 1)
|
public void setReflection(double reflection)
reflection
- the reflection constantpublic void setExpansion(double expansion)
expansion
- public void setContraction(double contraction)
contraction
- the contraction constantpublic void setShrink(double shrink)
shrink
- public Vec optimize(double eps, int iterationLimit, Function f, Function fd, Vec vars, List<Vec> inputs, Vec outputs, ExecutorService threadpool)
Optimizer
optimize
in interface Optimizer
eps
- the desired accuracy of the result.iterationLimit
- the maximum number of iteration steps to allow. This value must be positivef
- the function to optimize. This value can not be nullfd
- the derivative of the function to optimizevars
- contains the initial estimate of the minima. The length should be equal to the number of variables being solved for. This value may be altered. This value can not be null.inputs
- a list of input data point values to learn fromoutputs
- a vector containing the true values for each data point in inputsthreadpool
- a source of threads to perform computation withpublic Vec optimize(double eps, int iterationLimit, Function f, Function fd, Vec vars, List<Vec> inputs, Vec outputs)
Optimizer
optimize
in interface Optimizer
eps
- the desired accuracy of the result.iterationLimit
- the maximum number of iteration steps to allow. This value must be positivef
- the function to optimize. This value can not be nullfd
- the derivative of the function to optimizevars
- contains the initial estimate of the minima. The length should be equal to the number of variables being solved for. This value may be altered. This value can not be null.inputs
- a list of input data point values to learn fromoutputs
- a vector containing the true values for each data point in inputspublic Vec optimize(double eps, int iterationLimit, Function f, List<Vec> initalPoints)
eps
- the desired accuracy of the result.iterationLimit
- the maximum number of iteration steps to allow. This value must be positivef
- the function to optimize. This value can not be nullinitalPoints
- the list of initial guess points. If too small, new ones will be generated. if too large,
the extra ones will be ignored. This list may not be emptyCopyright © 2017. All rights reserved.