Package deepboof

Interface DFunction<T extends Tensor<T>>

All Superinterfaces:
Function<T>

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 Details

    • learning

      void learning()
      Puts the function into learning mode.
    • evaluating

      void evaluating()
      Puts the function into evaluation mode.
    • backwards

      void backwards(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.
      gradientInput - gradient of input Tensor
      gradientParameters - Gradients of all parameter Tensors. Same order as parameters in Function.forward(T, T)
    • isLearning

      boolean isLearning()
      Is the function in the learning state?
      Returns:
      true if in learning state or false if it's in the evaluation state