Class DistributionLoss

java.lang.Object
ai.djl.training.evaluator.Evaluator
ai.djl.training.loss.Loss
ai.djl.timeseries.distribution.DistributionLoss

public class DistributionLoss extends ai.djl.training.loss.Loss
DistributionLoss calculates loss for a given distribution.

Distribution Loss is calculated by Distribution.logProb(NDArray) at label point

  • Field Summary

    Fields inherited from class ai.djl.training.evaluator.Evaluator

    totalInstances
  • Constructor Summary

    Constructors
    Constructor
    Description
    Calculates Distribution Loss between the label and distribution.
  • Method Summary

    Modifier and Type
    Method
    Description
    ai.djl.ndarray.NDArray
    evaluate(ai.djl.ndarray.NDList labels, ai.djl.ndarray.NDList predictions)

    Methods inherited from class ai.djl.training.loss.Loss

    addAccumulator, elasticNetWeightedDecay, elasticNetWeightedDecay, elasticNetWeightedDecay, elasticNetWeightedDecay, getAccumulator, hingeLoss, hingeLoss, hingeLoss, l1Loss, l1Loss, l1Loss, l1WeightedDecay, l1WeightedDecay, l1WeightedDecay, l2Loss, l2Loss, l2Loss, l2WeightedDecay, l2WeightedDecay, l2WeightedDecay, maskedSoftmaxCrossEntropyLoss, maskedSoftmaxCrossEntropyLoss, maskedSoftmaxCrossEntropyLoss, quantileL1Loss, quantileL1Loss, resetAccumulator, sigmoidBinaryCrossEntropyLoss, sigmoidBinaryCrossEntropyLoss, sigmoidBinaryCrossEntropyLoss, softmaxCrossEntropyLoss, softmaxCrossEntropyLoss, softmaxCrossEntropyLoss, updateAccumulator, updateAccumulators

    Methods inherited from class ai.djl.training.evaluator.Evaluator

    checkLabelShapes, checkLabelShapes, getName

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DistributionLoss

      public DistributionLoss(String name, DistributionOutput distrOutput)
      Calculates Distribution Loss between the label and distribution.
      Parameters:
      name - the name of the loss
      distrOutput - the DistributionOutput to construct the target distribution
  • Method Details

    • evaluate

      public ai.djl.ndarray.NDArray evaluate(ai.djl.ndarray.NDList labels, ai.djl.ndarray.NDList predictions)
      Specified by:
      evaluate in class ai.djl.training.evaluator.Evaluator