cc.mallet.optimize
Class GradientAscent
java.lang.Object
cc.mallet.optimize.GradientAscent
- All Implemented Interfaces:
- Optimizer
public class GradientAscent
- extends java.lang.Object
- implements Optimizer
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GradientAscent
public GradientAscent(Optimizable.ByGradientValue function)
getOptimizable
public Optimizable getOptimizable()
- Specified by:
getOptimizable
in interface Optimizer
isConverged
public boolean isConverged()
- Specified by:
isConverged
in interface Optimizer
getLineMaximizer
public LineOptimizer.ByGradient getLineMaximizer()
setTolerance
public void setTolerance(double tolerance)
- Sets the tolerance in the convergence test:
2.0*|value-old_value| <= tolerance*(|value|+|old_value|+eps)
Default value is 0.001.
- Parameters:
tolerance
- tolerance for convergence test
getInitialStepSize
public double getInitialStepSize()
setInitialStepSize
public void setInitialStepSize(double initialStepSize)
getStpmax
public double getStpmax()
setStpmax
public void setStpmax(double stpmax)
optimize
public boolean optimize()
- Specified by:
optimize
in interface Optimizer
optimize
public boolean optimize(int numIterations)
- Specified by:
optimize
in interface Optimizer
setMaxStepSize
public void setMaxStepSize(double v)
setEvaluator
public void setEvaluator(OptimizerEvaluator.ByGradient eval)