Package cc.mallet.optimize
Class GradientAscent
- java.lang.Object
-
- cc.mallet.optimize.GradientAscent
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface cc.mallet.optimize.Optimizer
Optimizer.ByBatches
-
-
Constructor Summary
Constructors Constructor Description GradientAscent(Optimizable.ByGradientValue function)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getInitialStepSize()
LineOptimizer.ByGradient
getLineMaximizer()
Optimizable
getOptimizable()
double
getStpmax()
boolean
isConverged()
boolean
optimize()
boolean
optimize(int numIterations)
void
setEvaluator(OptimizerEvaluator.ByGradient eval)
void
setInitialStepSize(double initialStepSize)
void
setMaxStepSize(double v)
void
setStpmax(double stpmax)
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.
-
-
-
Constructor Detail
-
GradientAscent
public GradientAscent(Optimizable.ByGradientValue function)
-
-
Method Detail
-
getOptimizable
public Optimizable getOptimizable()
- Specified by:
getOptimizable
in interfaceOptimizer
-
isConverged
public boolean isConverged()
- Specified by:
isConverged
in interfaceOptimizer
-
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)
-
setMaxStepSize
public void setMaxStepSize(double v)
-
setEvaluator
public void setEvaluator(OptimizerEvaluator.ByGradient eval)
-
-