Package org.deeplearning4j.nn.gradient
Interface Gradient
-
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
DefaultGradient
public interface Gradient extends Serializable
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
clear()
Clear residual parameters (useful for returning a gradient and then clearing old objects)Character
flatteningOrderForVariable(String variable)
Return the gradient flattening order for the specified variable, or null if it is not explicitly setINDArray
getGradientFor(String variable)
The gradient for the given variableINDArray
gradient()
The full gradient as one flat vectorINDArray
gradient(List<String> order)
The full gradient as one flat vectorMap<String,INDArray>
gradientForVariable()
Gradient look up tableINDArray
setGradientFor(String variable, INDArray gradient)
Update gradient for the given variableINDArray
setGradientFor(String variable, INDArray gradient, Character flatteningOrder)
Update gradient for the given variable; also (optionally) specify the order in which the array should be flattened to a row vector
-
-
-
Method Detail
-
gradientForVariable
Map<String,INDArray> gradientForVariable()
Gradient look up table- Returns:
- the gradient look up table
-
gradient
INDArray gradient()
The full gradient as one flat vector- Returns:
-
clear
void clear()
Clear residual parameters (useful for returning a gradient and then clearing old objects)
-
getGradientFor
INDArray getGradientFor(String variable)
The gradient for the given variable- Parameters:
variable
- the variable to get the gradient for- Returns:
- the gradient for the given variable or null
-
setGradientFor
INDArray setGradientFor(String variable, INDArray gradient)
Update gradient for the given variable- Parameters:
variable
- the variable to get the gradient forgradient
- the gradient values- Returns:
- the gradient for the given variable or null
-
setGradientFor
INDArray setGradientFor(String variable, INDArray gradient, Character flatteningOrder)
Update gradient for the given variable; also (optionally) specify the order in which the array should be flattened to a row vector- Parameters:
variable
- the variable to get the gradient forgradient
- the gradient valuesflatteningOrder
- the order in which gradients should be flattened (null ok - default)- Returns:
- the gradient for the given variable or null
-
flatteningOrderForVariable
Character flatteningOrderForVariable(String variable)
Return the gradient flattening order for the specified variable, or null if it is not explicitly set- Parameters:
variable
- Variable to return the gradient flattening order for- Returns:
- Order in which the specified variable's gradient should be flattened
-
-