Interface ActivationFunction

All Known Implementing Classes:
Linear, Relu, Sigmoid, Softmax, Tanh

public interface ActivationFunction
An interface for activation functions.
  • Method Summary

    Modifier and Type
    Method
    Description
    linalg.Matrix
    back​(linalg.Matrix data)
    Applies backward pass of the activation function to a matrix (i.e.
    linalg.Matrix
    forward​(linalg.Matrix data)
    Applies the forward pass of activation function to a matrix.
    Gets the name of the activation function.
  • Method Details

    • forward

      linalg.Matrix forward(linalg.Matrix data)
      Applies the forward pass of activation function to a matrix.
      Parameters:
      data - The matrix to apply activation function to.
      Returns:
      The result of the element-wise activation function applied to the matrix.
    • back

      linalg.Matrix back(linalg.Matrix data)
      Applies backward pass of the activation function to a matrix (i.e. the derivative).
      Parameters:
      data - The matrix to apply the derivative of the activation function with respect to weights.
      Returns:
      The backward pass of the activation function for the data matrix.
    • getName

      String getName()
      Gets the name of the activation function.
      Returns:
      The name of the activation function as a String.