Enum Reduction

java.lang.Object
java.lang.Enum<Reduction>
org.tensorflow.framework.losses.Reduction
All Implemented Interfaces:
Serializable, Comparable<Reduction>

public enum Reduction extends Enum<Reduction>
Type of AbstractLoss Reduction

AUTO indicates that the reduction option will be determined by the usage context. For almost all cases this defaults to SUM_OVER_BATCH_SIZE.

NONE Weighted losses with one dimension reduced (axis=-1, or axis specified by loss function).

SUM Scalar sum of weighted losses.

SUM_OVER_BATCH_SIZE Scalar SUM divided by number of elements in losses.

  • Enum Constant Details

    • AUTO

      public static final Reduction AUTO
    • NONE

      public static final Reduction NONE
    • SUM

      public static final Reduction SUM
    • SUM_OVER_BATCH_SIZE

      public static final Reduction SUM_OVER_BATCH_SIZE
  • Method Details

    • values

      public static Reduction[] 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 Reduction 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
    • ofName

      public static Reduction ofName(String name)
      Get the Reduction based on name
      Parameters:
      name - the name of the reduction
      Returns:
      the Reduction