public enum LossReduce extends Enum<LossReduce>
Enum Constant and Description |
---|
MEAN_BY_NONZERO_WEIGHT_COUNT
Weighted mean: sum(weights * perOutputLoss) / count(weights != 0)
Example: 2d input, mean squared error loss. Output: squared_error_per_ex = weights * squaredDifference(predictions,labels) output = sum(squared_error_per_ex) / count(weights != 0) NOTE: if weights array is not provided, then weights default to scalar 1.0 and hence MEAN_BY_NONZERO_WEIGHT_COUNT is equivalent to MEAN_BY_WEIGHT |
MEAN_BY_WEIGHT
Weighted mean: sum(weights * perOutputLoss) / sum(weights) - gives a single scalar output
Example: 2d input, mean squared error Output: squared_error_per_ex = weights * squaredDifference(predictions,labels) output = sum(squared_error_per_ex) / sum(weights) NOTE: if weights array is not provided, then weights default to 1.0 for all entries - and hence MEAN_BY_WEIGHT is equivalent to MEAN_BY_NONZERO_WEIGHT_COUNT |
NONE
No reduction.
|
SUM
Weigted sum across all loss values, returning a scalar.
|
Modifier and Type | Method and Description |
---|---|
static LossReduce |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static LossReduce[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final LossReduce NONE
public static final LossReduce SUM
public static final LossReduce MEAN_BY_WEIGHT
public static final LossReduce MEAN_BY_NONZERO_WEIGHT_COUNT
public static LossReduce[] values()
for (LossReduce c : LossReduce.values()) System.out.println(c);
public static LossReduce valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullCopyright © 2019. All rights reserved.