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.
Method Summary
Modifier and Type
Method
Description
void
backwards(T input,
T dout,
T gradientInput,
List<T> gradientParameters)
Computes the derivatives of all the inputs and parameters to this function.
voidbackwards(T input,
T dout,
T gradientInput,
List<T> gradientParameters)
Computes the derivatives of all the inputs and parameters to this function. The Function.forward(T, T) function
must be called first before calling this one and the same inputs and parameters must be passed in.
Parameters:
input - The same input tensor which was passed in during the forward pass.
dout - Derivative of output, computed from next layer.