Package de.jungblut.math.minimize
Class AbstractMinimizer
- java.lang.Object
-
- de.jungblut.math.minimize.AbstractMinimizer
-
- All Implemented Interfaces:
Minimizer
- Direct Known Subclasses:
Fmincg,GradientDescent,OWLQN,ParticleSwarmOptimization
public abstract class AbstractMinimizer extends java.lang.Object implements Minimizer
Abstract minimizer class that adds functionality that can be shared between many minimizers. Currently it has just a iteration completion callback facility, but can be later extended to share line searching code or other shared utilities.- Author:
- thomas.jungblut
-
-
Constructor Summary
Constructors Constructor Description AbstractMinimizer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddIterationCompletionCallback(IterationCompletionListener lst)Add a callback listener that triggers after a iteration.protected voidonIterationFinished(int iteration, double cost, de.jungblut.math.DoubleVector currentWeights)Callback method that should be called from an explicit subclass once an iteration was finished.
-
-
-
Method Detail
-
addIterationCompletionCallback
public void addIterationCompletionCallback(IterationCompletionListener lst)
Add a callback listener that triggers after a iteration.- Parameters:
lst- the iteration completion listener.
-
onIterationFinished
protected final void onIterationFinished(int iteration, double cost, de.jungblut.math.DoubleVector currentWeights)Callback method that should be called from an explicit subclass once an iteration was finished.- Parameters:
iteration- the number of the current iteration.cost- the cost at the current iteration.currentWeights- the current optimal weights.
-
-