public class LayerUpdater extends Object implements Updater
Modifier and Type | Field and Description |
---|---|
protected Map<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,
String variable)
Update learning rate based on policy
|
void |
applyMomentumDecayPolicy(Layer layer,
int iteration,
String variable)
Update momentum if schedule exist
|
Updater |
clone() |
boolean |
equals(Object other) |
org.nd4j.linalg.api.ndarray.INDArray |
getStateViewArray() |
Map<String,org.nd4j.linalg.learning.GradientUpdater> |
getUpdaterForVariable() |
int |
hashCode() |
void |
init() |
org.nd4j.linalg.learning.GradientUpdater |
init(String variable,
Layer layer) |
void |
postApply(Layer layer,
org.nd4j.linalg.api.ndarray.INDArray gradient,
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 Map<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 Map<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, String param, int miniBatchSize)
layer
- gradient
- param
- public void applyMomentumDecayPolicy(Layer layer, int iteration, String variable)
public void applyLrDecayPolicy(LearningRatePolicy decay, Layer layer, int iteration, String variable)
public void preApply(Layer layer, Gradient gradient, int iteration)
public void init()
Copyright © 2016. All Rights Reserved.