Loss
Stay organized with collections
Save and categorize content based on your preferences.
Known Direct Subclasses
BinaryCrossentropy,
CategoricalCrossentropy,
CategoricalHinge,
CosineSimilarity,
Hinge,
Huber,
KLDivergence,
LogCosh,
MeanAbsoluteError,
MeanAbsolutePercentageError,
MeanSquaredError,
MeanSquaredLogarithmicError,
Poisson,
SparseCategoricalCrossentropy,
SquaredHinge
BinaryCrossentropy |
Computes the cross-entropy loss between true labels and predicted labels. |
CategoricalCrossentropy |
Computes the crossentropy loss between the labels and predictions. |
CategoricalHinge |
Computes the categorical hinge loss between labels and predictions. |
CosineSimilarity |
Computes the cosine similarity between labels and predictions. |
Hinge |
Computes the hinge loss between labels and predictions. |
Huber |
Computes the Huber loss between labels and predictions. |
KLDivergence |
Computes Kullback-Leibler divergence loss between labels and predictions. |
LogCosh |
Computes Computes the logarithm of the hyperbolic cosine of the prediction error. |
MeanAbsoluteError |
Computes the mean of absolute difference between labels and predictions. |
MeanAbsolutePercentageError |
Computes the mean absolute percentage error between labels and predictions. |
MeanSquaredError |
Computes the mean of squares of errors between labels and predictions. |
MeanSquaredLogarithmicError |
Computes the mean squared logarithmic errors between labels and predictions. |
Poisson |
Computes the Poisson loss between labels and predictions. |
SparseCategoricalCrossentropy |
Computes the crossentropy loss between labels and predictions. |
SquaredHinge |
Computes the squared hinge loss between labels and predictions. |
|
Inherited Methods
From class
java.lang.Object
boolean
|
equals(Object arg0)
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
Fields
public
static
final
Reduction
REDUCTION_DEFAULT
Public Methods
public
abstract
Operand<T>
call
(Operand<? extends TNumber> labels, Operand<T> predictions, Operand<T> sampleWeights)
Generates an Operand that calculates the loss.
Parameters
labels |
the truth values or labels |
predictions |
the predictions |
sampleWeights |
Optional sampleWeights acts as a coefficient for the loss. If a scalar is
provided, then the loss is simply scaled by the given value. If SampleWeights is a tensor
of size [batch_size], then the total loss for each sample of the batch is rescaled by the
corresponding element in the SampleWeights vector. If the shape of SampleWeights is
[batch_size, d0, .. dN-1] (or can be broadcast to this shape), then each loss element of
predictions is scaled by the corresponding value of SampleWeights. (Note on dN-1: all loss
functions reduce by 1 dimension, usually axis=-1.) |
Parameters
labels |
the truth values or labels |
predictions |
the predictions |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2021-11-29 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2021-11-29 UTC."],[],[]]