public class LayerUpdater extends java.lang.Object implements Updater
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.lang.String,org.nd4j.linalg.learning.GradientUpdater> |
updaterForVariable |
protected org.nd4j.linalg.api.ndarray.INDArray |
viewArray |
Constructor and Description |
---|
LayerUpdater() |
Modifier and Type | Method and Description |
---|---|
void |
applyLrDecayPolicy(LearningRatePolicy decay,
Layer layer,
int iteration,
java.lang.String variable)
Update learning rate based on policy
|
void |
applyMomentumDecayPolicy(Layer layer,
int iteration,
java.lang.String variable)
Update momentum if schedule exist
|
Updater |
clone() |
boolean |
equals(java.lang.Object other) |
org.nd4j.linalg.api.ndarray.INDArray |
getStateViewArray() |
java.util.Map<java.lang.String,org.nd4j.linalg.learning.GradientUpdater> |
getUpdaterForVariable() |
int |
hashCode() |
void |
init() |
org.nd4j.linalg.learning.GradientUpdater |
init(java.lang.String variable,
Layer layer) |
void |
postApply(Layer layer,
org.nd4j.linalg.api.ndarray.INDArray gradient,
java.lang.String param,
int miniBatchSize)
Apply the regularization
|
void |
preApply(Layer layer,
Gradient gradient,
int iteration)
Apply gradient normalization: scale based on L2, clipping etc.
|
void |
setStateViewArray(Layer layer,
org.nd4j.linalg.api.ndarray.INDArray viewArray,
boolean initialize)
Set the internal (historical) state view array for this updater
|
int |
stateSizeForLayer(Layer layer)
Calculate and return the state size for this updater (for the given layer).
|
void |
update(Layer layer,
Gradient gradient,
int iteration,
int miniBatchSize)
Updater: updates the model
|
protected java.util.Map<java.lang.String,org.nd4j.linalg.learning.GradientUpdater> updaterForVariable
protected org.nd4j.linalg.api.ndarray.INDArray viewArray
public void setStateViewArray(Layer layer, org.nd4j.linalg.api.ndarray.INDArray viewArray, boolean initialize)
Updater
setStateViewArray
in interface Updater
layer
- Layer that this updater belongs toviewArray
- View arrayinitialize
- Whether to initialize the array or notpublic java.util.Map<java.lang.String,org.nd4j.linalg.learning.GradientUpdater> getUpdaterForVariable()
public org.nd4j.linalg.api.ndarray.INDArray getStateViewArray()
getStateViewArray
in interface Updater
public int stateSizeForLayer(Layer layer)
Updater
stateSizeForLayer
in interface Updater
layer
- Layer that this updater belongs topublic void update(Layer layer, Gradient gradient, int iteration, int miniBatchSize)
Updater
public void postApply(Layer layer, org.nd4j.linalg.api.ndarray.INDArray gradient, java.lang.String param, int miniBatchSize)
layer
- gradient
- param
- public void applyMomentumDecayPolicy(Layer layer, int iteration, java.lang.String variable)
public void applyLrDecayPolicy(LearningRatePolicy decay, Layer layer, int iteration, java.lang.String variable)
public void preApply(Layer layer, Gradient gradient, int iteration)
public void init()
public org.nd4j.linalg.learning.GradientUpdater init(java.lang.String variable, Layer layer)
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object