public class LossFunctions extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
LossFunctions.Reduction |
| Modifier and Type | Method and Description |
|---|---|
static LossInfo |
l1(String outputName,
SDVariable predictions,
SDVariable label,
SDVariable weights,
LossFunctions.Reduction reduction,
int... dimensions)
L1 loss - sum of absolute errors.
|
static LossInfo |
l2(String outputName,
SDVariable predictions,
SDVariable label,
SDVariable weights,
LossFunctions.Reduction reduction,
int... dimensions)
L2 loss function: i.e., sum of squared errors, L = sum_i (actual_i - predicted)^2
|
static LossInfo |
mcxent(String outputName,
SDVariable predictions,
SDVariable label,
SDVariable weights,
LossFunctions.Reduction reduction,
int... dimensions)
Multi-Class Cross Entropy loss function:
L = sum_i actual_i * log( predicted_i ) |
static LossInfo |
mse(String outputName,
SDVariable predictions,
SDVariable label,
SDVariable weights,
LossFunctions.Reduction reduction,
int... dimensions)
Mean squared error: L = mean( (predicted - label)^2)
|
static LossInfo |
negativeLogLikelihood(String outputName,
SDVariable predictions,
SDVariable label,
SDVariable weights,
LossFunctions.Reduction reduction,
int... dimensions) |
public static LossInfo mse(String outputName, SDVariable predictions, SDVariable label, SDVariable weights, LossFunctions.Reduction reduction, int... dimensions)
outputName - Name of the output SDVariablepredictions - Predictions variablelabel - Label variableweights - Weights array. May be null, or any broadcastable shape (with predictions/label arrays).
Note that this is also used for masking (weight of 0 = 'masked out')reduction - Type of reduction to perform for the loss functiondimensions - Dimension(s) to apply the loss function onpublic static LossInfo l1(String outputName, SDVariable predictions, SDVariable label, SDVariable weights, LossFunctions.Reduction reduction, int... dimensions)
outputName - predictions - label - weights - reduction - dimensions - public static LossInfo l2(String outputName, SDVariable predictions, SDVariable label, SDVariable weights, LossFunctions.Reduction reduction, int... dimensions)
outputName - predictions - label - weights - reduction - dimensions - public static LossInfo negativeLogLikelihood(String outputName, SDVariable predictions, SDVariable label, SDVariable weights, LossFunctions.Reduction reduction, int... dimensions)
public static LossInfo mcxent(String outputName, SDVariable predictions, SDVariable label, SDVariable weights, LossFunctions.Reduction reduction, int... dimensions)
outputName - predictions - label - weights - reduction - dimensions - Copyright © 2018. All rights reserved.