Interface JacobianNumerical<T>

All Known Implementing Classes:
JacobianNumerical_F64

public interface JacobianNumerical<T>
Given a CROperatorForward implementations of this interface will compute the gradient of its inputs and parameters. Numerical differentiation is done using a symmetric sample, e.g. dx = [f(x+T)-f(x-T)]/T
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    configure(double T)
    Overrides default settings for computing numerical gradient.
    void
    differentiate(CRMatrix<T> dout, List<CRMatrix<T>> jacInputs)
    Performs numerical differentiation to compute the gradients of input and parameters.
    void
    setFunction(List<CRArray<T>> inputs, CROperatorForward<T> function)
    Specifies the function which will be differentiated.
  • Method Details

    • configure

      void configure(double T)
      Overrides default settings for computing numerical gradient.
      Parameters:
      T - Sampling distance used for numerical differentiation
    • setFunction

      void setFunction(List<CRArray<T>> inputs, CROperatorForward<T> function)
      Specifies the function which will be differentiated.
      Parameters:
      inputs - Value of all inputs passed into the function
      function - The function which is to be differentiated
    • differentiate

      void differentiate(CRMatrix<T> dout, List<CRMatrix<T>> jacInputs)
      Performs numerical differentiation to compute the gradients of input and parameters. The value of parameters will be the current parameters stored in the function.
      Parameters:
      dout - (Input) Output's Jacobian, computed from next layer.
      jacInputs - (Output) Storage for input Jacobians