Enum Class OutputFunction

java.lang.Object
java.lang.Enum<OutputFunction>
smile.base.mlp.OutputFunction
All Implemented Interfaces:
Serializable, Comparable<OutputFunction>, Constable

public enum OutputFunction extends Enum<OutputFunction>
The output function of neural networks.
  • Enum Constant Details

    • LINEAR

      public static final OutputFunction LINEAR
      Linear/Identity function.
    • SIGMOID

      public static final OutputFunction SIGMOID
      Logistic sigmoid function: sigmoid(v)=1/(1+exp(-v)). For multi-class classification, each unit in output layer corresponds to a class. For binary classification and cross entropy error function, there is only one output unit whose value can be regarded as posteriori probability.
    • SOFTMAX

      public static final OutputFunction SOFTMAX
      Softmax for multi-class cross entropy objection function. The values of units in output layer can be regarded as posteriori probabilities of each class.
  • Method Details

    • values

      public static OutputFunction[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static OutputFunction valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • f

      public abstract void f(double[] x)
      The output function.
      Parameters:
      x - the input vector.
    • g

      public abstract void g(Cost cost, double[] g, double[] y)
      The gradient function.
      Parameters:
      cost - the cost function of neural network.
      g - the gradient vector. On input, it holds target - output. On output, it is the gradient.
      y - the output vector.