org.nd4j.linalg.learning
Class AdaGrad
- java.lang.Object
-
- org.nd4j.linalg.learning.AdaGrad
-
- All Implemented Interfaces:
- java.io.Serializable
public class AdaGrad extends java.lang.Object implements java.io.SerializableVectorized Learning Rate used per Connection Weight Adapted from: http://xcorr.net/2014/01/23/adagrad-eliminating-learning-rates-in-stochastic-gradient-descent/- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description INDArrayadjustedGradientdoublefudgeFactorINDArraygradientINDArrayhistoricalGradientint[]shape
-
Constructor Summary
Constructors Constructor and Description AdaGrad(int[] shape)Create adagrad with the specified shapeAdaGrad(int rows, int cols)Initializes adagrad with a gamma of 1e-2AdaGrad(int rows, int cols, double gamma)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description INDArraygetLearningRates(INDArray gradient)Gets feature specific learning rates Adagrad keeps a history of gradients being passed in.doublegetMasterStepSize()booleanisDecayLr()voidsetDecayLr(boolean decayLr)voidsetMasterStepSize(double masterStepSize)
-
-
-
Field Detail
-
historicalGradient
public INDArray historicalGradient
-
adjustedGradient
public INDArray adjustedGradient
-
fudgeFactor
public double fudgeFactor
-
gradient
public INDArray gradient
-
shape
public int[] shape
-
-
Constructor Detail
-
AdaGrad
public AdaGrad(int rows, int cols, double gamma)
-
AdaGrad
public AdaGrad(int[] shape)
Create adagrad with the specified shape- Parameters:
shape-
-
AdaGrad
public AdaGrad(int rows, int cols)Initializes adagrad with a gamma of 1e-2- Parameters:
rows- the rows for the gradientscols- the number of columns for the gradient
-
-
Method Detail
-
getLearningRates
public INDArray getLearningRates(INDArray gradient)
Gets feature specific learning rates Adagrad keeps a history of gradients being passed in. Note that each gradient passed in becomes adapted over time, hence the name adagrad- Parameters:
gradient- the gradient to getFromOrigin learning rates for- Returns:
- the feature specific learning rates
-
getMasterStepSize
public double getMasterStepSize()
-
setMasterStepSize
public void setMasterStepSize(double masterStepSize)
-
isDecayLr
public boolean isDecayLr()
-
setDecayLr
public void setDecayLr(boolean decayLr)
-
-
DMelt 3.0 © DataMelt by jWork.ORG