public class AdaGrad extends Object implements Serializable, GradientUpdater
Modifier and Type | Field and Description |
---|---|
protected boolean |
decayLr |
INDArray |
historicalGradient |
protected double |
masterStepSize |
protected int |
numIterations |
protected static long |
serialVersionUID |
int[] |
shape |
Constructor and Description |
---|
AdaGrad(int[] shape)
Create adagrad with the specified shape
|
AdaGrad(int[] shape,
double gamma)
Create adagrad with the specified shape
|
AdaGrad(int rows,
int cols)
Initializes adagrad with a gamma of 1e-2
|
AdaGrad(int rows,
int cols,
double gamma) |
Modifier and Type | Method and Description |
---|---|
AdaGrad |
createSubset(int index) |
double |
getGradient(double gradient,
int column,
int[] shape)
Gets feature specific learning rates
Adagrad keeps a history of gradients being passed in.
|
INDArray |
getGradient(INDArray gradient,
int iteration)
Gets feature specific learning rates
Adagrad keeps a history of gradients being passed in.
|
INDArray |
getGradient(INDArray gradient,
int slice,
int[] shape)
Gets feature specific learning rates
Adagrad keeps a history of gradients being passed in.
|
INDArray |
getHistoricalGradient() |
double |
getMasterStepSize() |
boolean |
isDecayLr() |
void |
setDecayLr(boolean decayLr) |
void |
setHistoricalGradient(INDArray historicalGradient) |
void |
setMasterStepSize(double masterStepSize) |
protected static final long serialVersionUID
public INDArray historicalGradient
public int[] shape
protected double masterStepSize
protected int numIterations
protected boolean decayLr
public AdaGrad(int rows, int cols, double gamma)
rows
- cols
- gamma
- public AdaGrad(int[] shape, double gamma)
shape
- public AdaGrad(int[] shape)
shape
- public AdaGrad(int rows, int cols)
rows
- the rows for the gradientscols
- the number of columns for the gradientpublic double getGradient(double gradient, int column, int[] shape)
gradient
- the gradient to get learning rates forcolumn
- the slice of the gradient history to useshape
- the shape of the nd array for the historical gradientpublic AdaGrad createSubset(int index)
index
- public INDArray getGradient(INDArray gradient, int slice, int[] shape)
gradient
- the gradient to get learning rates forslice
- the slice of the gradient history to useshape
- the shape of the nd array for the historical gradientpublic INDArray getGradient(INDArray gradient, int iteration)
getGradient
in interface GradientUpdater
gradient
- the gradient to get learning rates foriteration
- public INDArray getHistoricalGradient()
public void setHistoricalGradient(INDArray historicalGradient)
public double getMasterStepSize()
public void setMasterStepSize(double masterStepSize)
public boolean isDecayLr()
public void setDecayLr(boolean decayLr)
Copyright © 2015. All Rights Reserved.