Enum ActivationFunction

Object
Enum<ActivationFunction>
ActivationFunction
All Implemented Interfaces:
Serializable, Comparable<ActivationFunction>, Constable

public enum ActivationFunction
extends Enum<ActivationFunction>
This enum represents the available activation functions f: Rn→ Rn for use with neural networks. Use the get(ArrayList, ActivationFunction) or getDerivative(ArrayList, ArrayList, ActivationFunction) to get computations for the function and the derivative resp.
  • Enum Constant Details

  • Method Details

    • values

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

      public static ActivationFunction valueOf​(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified name
      NullPointerException - if the argument is null
    • get

      public static Computation<ArrayList<DRes<SFixed>>,​ProtocolBuilderNumeric> get​(ArrayList<DRes<SFixed>> x, ActivationFunction type)
    • getDerivative

      public static Computation<ArrayList<DRes<SFixed>>,​ProtocolBuilderNumeric> getDerivative​(ArrayList<DRes<SFixed>> x, ArrayList<DRes<SFixed>> y, ActivationFunction type)
      Compute f'(x) for the given activation function f: Rn → Rn. The function value y = f(x) may be used in the computation if it makes the computation easier for the given function.