Loss

public abstract class Loss
Known Direct Subclasses

Fields

public static final Reduction REDUCTION_DEFAULT

Public Methods

abstract <T extends TNumber> Operand<T>
call(Operand<? extends TNumber> labels, Operand<T> predictions, Operand<T> sampleWeights)
Generates an Operand that calculates the loss.
<T extends TNumber> Operand<T>
call(Operand<? extends TNumber> labels, Operand<T> predictions)
Calculates the loss
Reduction
getReduction()
Gets the loss reduction
Ops
getTF()
Gets the TensorFlow Ops

Inherited Methods

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.)
Returns
  • the loss

public Operand<T> call (Operand<? extends TNumber> labels, Operand<T> predictions)

Calculates the loss

Parameters
labels the truth values or labels
predictions the predictions
Returns
  • the loss

public Reduction getReduction ()

Gets the loss reduction

Returns
  • the loss reduction

public Ops getTF ()

Gets the TensorFlow Ops

Returns
  • the TensorFlow Ops