Package org.nd4j.linalg.learning
Class SgdUpdater
- java.lang.Object
-
- org.nd4j.linalg.learning.SgdUpdater
-
- All Implemented Interfaces:
GradientUpdater<Sgd>
public class SgdUpdater extends Object implements GradientUpdater<Sgd>
SGD updater applies a learning rate only- Author:
- Adam Gibson
-
-
Constructor Summary
Constructors Constructor Description SgdUpdater(Sgd config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
applyUpdater(INDArray gradient, int iteration, int epoch)
Modify the gradient to be an update.Map<String,INDArray>
getState()
void
setState(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
-
-
-
-
Constructor Detail
-
SgdUpdater
public SgdUpdater(Sgd config)
-
-
Method Detail
-
setState
public void setState(Map<String,INDArray> stateMap, boolean initialize)
- Specified by:
setState
in interfaceGradientUpdater<Sgd>
-
getState
public Map<String,INDArray> getState()
- Specified by:
getState
in interfaceGradientUpdater<Sgd>
-
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<Sgd>
- 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)
Description copied from interface:GradientUpdater
Modify the gradient to be an update. Note that this is be done in-place- Specified by:
applyUpdater
in interfaceGradientUpdater<Sgd>
- Parameters:
gradient
- the gradient to modify
-
-