Package smile.deep

Interface Loss

All Superinterfaces:
BiFunction<Tensor,Tensor,Tensor>

public interface Loss extends BiFunction<Tensor,Tensor,Tensor>
Loss functions.
  • Method Details

    • l1

      static Loss l1()
      Mean Absolute Error (L1) Loss Function.
      Returns:
      the loss functor.
    • mse

      static Loss mse()
      Mean Squared Error (L2) Loss Function.
      Returns:
      the loss functor.
    • nll

      static Loss nll()
      Negative Log-Likelihood Loss Function.
      Returns:
      the loss functor.
    • crossEntropy

      static Loss crossEntropy()
      Cross Entropy Loss Function.
      Returns:
      the loss functor.
    • hingeEmbedding

      static Loss hingeEmbedding()
      Hinge Embedding Loss Function.
      Returns:
      the loss functor.
    • kl

      static Loss kl()
      Kullback-Leibler Divergence Loss Function.
      Returns:
      the loss functor.
    • marginRanking

      static Tensor marginRanking(Tensor input1, Tensor input2, Tensor target)
      Margin Ranking Loss Function.
      Parameters:
      input1 - the first input.
      input2 - the second input.
      target - the target/truth.
      Returns:
      the loss.
    • tripleMarginRanking

      static Tensor tripleMarginRanking(Tensor anchor, Tensor positive, Tensor negative)
      Triplet Margin Ranking Loss Function.
      Parameters:
      anchor - the first input.
      positive - the second input.
      negative - the third input.
      Returns:
      the loss.