Package smile.deep
Interface Loss
- All Superinterfaces:
BiFunction<Tensor,Tensor, Tensor>
Loss functions.
-
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic LossCross Entropy Loss Function.static LossHinge Embedding Loss Function.static Losskl()Kullback-Leibler Divergence Loss Function.static Lossl1()Mean Absolute Error (L1) Loss Function.static TensormarginRanking(Tensor input1, Tensor input2, Tensor target) Margin Ranking Loss Function.static Lossmse()Mean Squared Error (L2) Loss Function.static Lossnll()Negative Log-Likelihood Loss Function.static TensortripleMarginRanking(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.
-