public interface DFunction<T extends Tensor<T>> extends Function<T>
Functions which also implement the backwards step and compute the gradient for all inputs.
Functions have two modes for operation, learning and evaluating. When in learning mode they are free
to modify their internal state during the forward step, otherwise, while in evaluation mode, they are not
allowed to modify their state. By default, all functions start in evaluation mode.| Modifier and Type | Method and Description |
|---|---|
void |
backwards(T input,
T dout,
T gradientInput,
java.util.List<T> gradientParameters)
Computes the derivatives of all the inputs and parameters to this function.
|
void |
evaluating()
Puts the function into evaluation mode.
|
boolean |
isLearning()
Is the function in the learning state?
|
void |
learning()
Puts the function into learning mode.
|
forward, getOutputShape, getParameters, getParameterShapes, getTensorType, initialize, setParametersvoid learning()
void evaluating()
void backwards(T input, T dout, T gradientInput, java.util.List<T> gradientParameters)
Function.forward(T, T) function
must be called first before calling this one and the same inputs and parameters must be passed in.input - The same input tensor which was passed in during the forward pass.dout - Derivative of output, computed from next layer.gradientInput - gradient of input TensorgradientParameters - Gradients of all parameter Tensors. Same order as parameters
in Function.forward(T, T)boolean isLearning()