Package org.nd4j.linalg.learning
Class AdamUpdater
- java.lang.Object
-
- org.nd4j.linalg.learning.AdamUpdater
-
- All Implemented Interfaces:
GradientUpdater<Adam>
public class AdamUpdater extends Object implements GradientUpdater<Adam>
The Adam updater. https://arxiv.org/abs/1412.6980- Author:
- Adam Gibson
-
-
Constructor Summary
Constructors Constructor Description AdamUpdater(Adam config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
applyUpdater(INDArray gradient, int iteration, int epoch)
Calculate the update based on the given gradientMap<String,INDArray>
getState()
void
setState(@NonNull Map<String,INDArray> stateMap, boolean initialize)
void
setStateViewArray(INDArray viewArray, long[] gradientShape, char gradientOrder, boolean initialize)
For the internal updater state (if any): set this to use the provided array.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.nd4j.linalg.learning.GradientUpdater
getConfig
-
-
-
-
Field Detail
-
M_STATE
public static final String M_STATE
- See Also:
- Constant Field Values
-
V_STATE
public static final String V_STATE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AdamUpdater
public AdamUpdater(Adam config)
-
-
Method Detail
-
setState
public void setState(@NonNull @NonNull Map<String,INDArray> stateMap, boolean initialize)
- Specified by:
setState
in interfaceGradientUpdater<Adam>
-
getState
public Map<String,INDArray> getState()
- Specified by:
getState
in interfaceGradientUpdater<Adam>
-
setStateViewArray
public void setStateViewArray(INDArray viewArray, long[] gradientShape, char gradientOrder, boolean initialize)
Description copied from interface:GradientUpdater
For the internal updater state (if any): set this to use the provided array. Used during initialization, and when restoring the updater state (after serialization, for example)- Specified by:
setStateViewArray
in interfaceGradientUpdater<Adam>
- Parameters:
viewArray
- Array (that is a view of a larger array) to use for the state.initialize
- If true: the updater must initialize the view array. If false: no change to view array contents
-
applyUpdater
public void applyUpdater(INDArray gradient, int iteration, int epoch)
Calculate the update based on the given gradient- Specified by:
applyUpdater
in interfaceGradientUpdater<Adam>
- Parameters:
gradient
- the gradient to get the update foriteration
-
-
-