gov.sandia.cognition.learning.algorithm.minimization
Class AbstractAnytimeFunctionMinimizer<InputType,OutputType,EvaluatorType extends Evaluator<? super InputType,? extends OutputType>>

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.algorithm.AbstractIterativeAlgorithm
          extended by gov.sandia.cognition.algorithm.AbstractAnytimeAlgorithm<ResultType>
              extended by gov.sandia.cognition.learning.algorithm.AbstractAnytimeBatchLearner<EvaluatorType,InputOutputPair<InputType,OutputType>>
                  extended by gov.sandia.cognition.learning.algorithm.minimization.AbstractAnytimeFunctionMinimizer<InputType,OutputType,EvaluatorType>
Type Parameters:
InputType - Input class of the Evaluator that we are trying to minimize, such as Vector
OutputType - Output class of the Evaluator that we are trying to minimize, such as Double
EvaluatorType - Evaluator class that this minimization algorithm can handle, such as Evaluator or DifferentiableEvaluator.
All Implemented Interfaces:
AnytimeAlgorithm<InputOutputPair<InputType,OutputType>>, IterativeAlgorithm, StoppableAlgorithm, AnytimeBatchLearner<EvaluatorType,InputOutputPair<InputType,OutputType>>, BatchLearner<EvaluatorType,InputOutputPair<InputType,OutputType>>, FunctionMinimizer<InputType,OutputType,EvaluatorType>, CloneableSerializable, Serializable, Cloneable
Direct Known Subclasses:
AbstractAnytimeLineMinimizer, FunctionMinimizerConjugateGradient, FunctionMinimizerDirectionSetPowell, FunctionMinimizerGradientDescent, FunctionMinimizerNelderMead, FunctionMinimizerQuasiNewton

public abstract class AbstractAnytimeFunctionMinimizer<InputType,OutputType,EvaluatorType extends Evaluator<? super InputType,? extends OutputType>>
extends AbstractAnytimeBatchLearner<EvaluatorType,InputOutputPair<InputType,OutputType>>
implements FunctionMinimizer<InputType,OutputType,EvaluatorType>

A partial implementation of a minimization algorithm that is iterative, stoppable, and approximate.

Since:
2.0
Author:
Kevin R. Dixon
See Also:
Serialized Form

Field Summary
protected  InputType initialGuess
          Initial guess of the minimization routine
protected  InputOutputPair<InputType,OutputType> result
          Resulting minimum input-output pair
protected  double tolerance
          Tolerance of the minimization algorithm, must be >= 0.0
 
Fields inherited from class gov.sandia.cognition.learning.algorithm.AbstractAnytimeBatchLearner
data, keepGoing
 
Fields inherited from class gov.sandia.cognition.algorithm.AbstractAnytimeAlgorithm
maxIterations
 
Fields inherited from class gov.sandia.cognition.algorithm.AbstractIterativeAlgorithm
DEFAULT_ITERATION, iteration
 
Constructor Summary
AbstractAnytimeFunctionMinimizer(InputType initialGuess, double tolerance, int maxIterations)
          Creates a new instance of AbstractStandardIterativeMinimizationAlgorithm
 
Method Summary
 InputType getInitialGuess()
          Getter for initialGuess
 InputOutputPair<InputType,OutputType> getResult()
          Getter for result
 double getTolerance()
          Getter for tolerance
 void setInitialGuess(InputType initialGuess)
          Setter for initialGuess
protected  void setResult(InputOutputPair<InputType,OutputType> result)
          Setter for result
 void setTolerance(double tolerance)
          Setter for tolerance
 
Methods inherited from class gov.sandia.cognition.learning.algorithm.AbstractAnytimeBatchLearner
cleanupAlgorithm, clone, getData, getKeepGoing, initializeAlgorithm, learn, setData, setKeepGoing, step, stop
 
Methods inherited from class gov.sandia.cognition.algorithm.AbstractAnytimeAlgorithm
getMaxIterations, isResultValid, setMaxIterations
 
Methods inherited from class gov.sandia.cognition.algorithm.AbstractIterativeAlgorithm
addIterativeAlgorithmListener, fireAlgorithmEnded, fireAlgorithmStarted, fireStepEnded, fireStepStarted, getIteration, getListeners, removeIterativeAlgorithmListener, setIteration, setListeners
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gov.sandia.cognition.learning.algorithm.minimization.FunctionMinimizer
learn
 
Methods inherited from interface gov.sandia.cognition.util.CloneableSerializable
clone
 
Methods inherited from interface gov.sandia.cognition.algorithm.AnytimeAlgorithm
getMaxIterations, setMaxIterations
 
Methods inherited from interface gov.sandia.cognition.algorithm.IterativeAlgorithm
addIterativeAlgorithmListener, getIteration, removeIterativeAlgorithmListener
 
Methods inherited from interface gov.sandia.cognition.algorithm.StoppableAlgorithm
isResultValid, stop
 

Field Detail

tolerance

protected double tolerance
Tolerance of the minimization algorithm, must be >= 0.0


result

protected InputOutputPair<InputType,OutputType> result
Resulting minimum input-output pair


initialGuess

protected InputType initialGuess
Initial guess of the minimization routine

Constructor Detail

AbstractAnytimeFunctionMinimizer

public AbstractAnytimeFunctionMinimizer(InputType initialGuess,
                                        double tolerance,
                                        int maxIterations)
Creates a new instance of AbstractStandardIterativeMinimizationAlgorithm

Parameters:
initialGuess - Initial guess of the minimization routine
tolerance - Tolerance of the minimization algorithm, must be >= 0.0
maxIterations - Maximum number of iterations to run before stopping
Method Detail

getResult

public InputOutputPair<InputType,OutputType> getResult()
Getter for result

Specified by:
getResult in interface AnytimeAlgorithm<InputOutputPair<InputType,OutputType>>
Returns:
Resulting minimum input-output pair

setResult

protected void setResult(InputOutputPair<InputType,OutputType> result)
Setter for result

Parameters:
result - Resulting minimum input-output pair

getTolerance

public double getTolerance()
Getter for tolerance

Specified by:
getTolerance in interface FunctionMinimizer<InputType,OutputType,EvaluatorType extends Evaluator<? super InputType,? extends OutputType>>
Returns:
Tolerance of the minimization algorithm, must be >= 0.0

setTolerance

public void setTolerance(double tolerance)
Setter for tolerance

Specified by:
setTolerance in interface FunctionMinimizer<InputType,OutputType,EvaluatorType extends Evaluator<? super InputType,? extends OutputType>>
Parameters:
tolerance - Tolerance of the minimization algorithm, must be >= 0.0

getInitialGuess

public InputType getInitialGuess()
Getter for initialGuess

Specified by:
getInitialGuess in interface FunctionMinimizer<InputType,OutputType,EvaluatorType extends Evaluator<? super InputType,? extends OutputType>>
Returns:
Initial guess of the minimization routine

setInitialGuess

public void setInitialGuess(InputType initialGuess)
Setter for initialGuess

Specified by:
setInitialGuess in interface FunctionMinimizer<InputType,OutputType,EvaluatorType extends Evaluator<? super InputType,? extends OutputType>>
Parameters:
initialGuess - Initial guess of the minimization routine