org.nd4j.linalg.solvers
Class VectorizedDeepLearningGradientAscent
- java.lang.Object
-
- org.nd4j.linalg.solvers.VectorizedDeepLearningGradientAscent
-
- All Implemented Interfaces:
- OptimizerMatrix
public class VectorizedDeepLearningGradientAscent extends java.lang.Object implements OptimizerMatrix
Vectorized Stochastic Gradient Ascent
-
-
Constructor Summary
Constructors Constructor and Description VectorizedDeepLearningGradientAscent(OptimizableByGradientValueMatrix function)VectorizedDeepLearningGradientAscent(OptimizableByGradientValueMatrix function, double initialStepSize)VectorizedDeepLearningGradientAscent(OptimizableByGradientValueMatrix function, double initialStepSize, IterationListener listener)VectorizedDeepLearningGradientAscent(OptimizableByGradientValueMatrix function, IterationListener listener)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description doublegetInitialStepSize()VectorizedBackTrackLineSearchgetLineMaximizer()OptimizableByGradientValueMatrixgetOptimizable()doublegetStpmax()booleanisConverged()Whether the algorithm is convergedbooleanoptimize()Run optimizebooleanoptimize(int numIterations)Run optimize up to the specified number of epochsvoidsetInitialStepSize(double initialStepSize)voidsetMaxIterations(int maxIterations)The default max number of iterations to runvoidsetMaxStepSize(double v)voidsetStpmax(double stpmax)voidsetTolerance(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
-
VectorizedDeepLearningGradientAscent
public VectorizedDeepLearningGradientAscent(OptimizableByGradientValueMatrix function, double initialStepSize)
-
VectorizedDeepLearningGradientAscent
public VectorizedDeepLearningGradientAscent(OptimizableByGradientValueMatrix function, IterationListener listener)
-
VectorizedDeepLearningGradientAscent
public VectorizedDeepLearningGradientAscent(OptimizableByGradientValueMatrix function, double initialStepSize, IterationListener listener)
-
VectorizedDeepLearningGradientAscent
public VectorizedDeepLearningGradientAscent(OptimizableByGradientValueMatrix function)
-
-
Method Detail
-
setMaxIterations
public void setMaxIterations(int maxIterations)
Description copied from interface:OptimizerMatrixThe default max number of iterations to run- Specified by:
setMaxIterationsin interfaceOptimizerMatrix
-
getOptimizable
public OptimizableByGradientValueMatrix getOptimizable()
-
isConverged
public boolean isConverged()
Description copied from interface:OptimizerMatrixWhether the algorithm is converged- Specified by:
isConvergedin interfaceOptimizerMatrix- Returns:
- true if the algorithm converged, false otherwise
-
getLineMaximizer
public VectorizedBackTrackLineSearch 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.- Specified by:
setTolerancein interfaceOptimizerMatrix- 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()
Description copied from interface:OptimizerMatrixRun optimize- Specified by:
optimizein interfaceOptimizerMatrix- Returns:
- whether the algorithm converged properly
-
optimize
public boolean optimize(int numIterations)
Description copied from interface:OptimizerMatrixRun optimize up to the specified number of epochs- Specified by:
optimizein interfaceOptimizerMatrix- Parameters:
numIterations- the max number of epochs to run- Returns:
- whether the algorihtm converged properly
-
setMaxStepSize
public void setMaxStepSize(double v)
-
-
DMelt 3.0 © DataMelt by jWork.ORG