Enum Bidirectional.Mode

  • All Implemented Interfaces:
    Serializable, Comparable<Bidirectional.Mode>
    Enclosing class:
    Bidirectional

    public static enum Bidirectional.Mode
    extends Enum<Bidirectional.Mode>
    This Mode enumeration defines how the activations for the forward and backward networks should be combined.
    ADD: out = forward + backward (elementwise addition)
    MUL: out = forward * backward (elementwise multiplication)
    AVERAGE: out = 0.5 * (forward + backward)
    CONCAT: Concatenate the activations.
    Where 'forward' is the activations for the forward RNN, and 'backward' is the activations for the backward RNN. In all cases except CONCAT, the output activations size is the same size as the standard RNN that is being wrapped by this layer. In the CONCAT case, the output activations size (dimension 1) is 2x larger than the standard RNN's activations array.
    • Method Detail

      • values

        public static Bidirectional.Mode[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (Bidirectional.Mode c : Bidirectional.Mode.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static Bidirectional.Mode 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