Package smile.deep
Interface Loss
- All Superinterfaces:
BiFunction<Tensor,
Tensor, Tensor>
Loss functions.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Loss
Cross Entropy Loss Function.static Loss
Hinge Embedding Loss Function.static Loss
kl()
Kullback-Leibler Divergence Loss Function.static Loss
l1()
Mean Absolute Error (L1) Loss Function.static Tensor
marginRanking
(Tensor input1, Tensor input2, Tensor target) Margin Ranking Loss Function.static Loss
mse()
Mean Squared Error (L2) Loss Function.static Loss
nll()
Negative Log-Likelihood Loss Function.static Tensor
tripleMarginRanking
(Tensor anchor, Tensor positive, Tensor negative) Triplet Margin Ranking Loss Function.Methods inherited from interface java.util.function.BiFunction
andThen, apply
-
Method Details
-
l1
Mean Absolute Error (L1) Loss Function.- Returns:
- the loss functor.
-
mse
Mean Squared Error (L2) Loss Function.- Returns:
- the loss functor.
-
nll
Negative Log-Likelihood Loss Function.- Returns:
- the loss functor.
-
crossEntropy
Cross Entropy Loss Function.- Returns:
- the loss functor.
-
hingeEmbedding
Hinge Embedding Loss Function.- Returns:
- the loss functor.
-
kl
Kullback-Leibler Divergence Loss Function.- Returns:
- the loss functor.
-
marginRanking
Margin Ranking Loss Function.- Parameters:
input1
- the first input.input2
- the second input.target
- the target/truth.- Returns:
- the loss.
-
tripleMarginRanking
Triplet Margin Ranking Loss Function.- Parameters:
anchor
- the first input.positive
- the second input.negative
- the third input.- Returns:
- the loss.
-