Interface LabelObjective

All Superinterfaces:
com.oracle.labs.mlrg.olcut.config.Configurable, com.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>, SGDObjective<Integer>
All Known Implementing Classes:
Hinge, LogMulticlass

public interface LabelObjective extends SGDObjective<Integer>
An interface for single label prediction objectives.

An objective knows if it generates a probabilistic model or not, and what kind of normalization needs to be applied to produce probability values.

  • Method Details

    • valueAndGradient

      @Deprecated com.oracle.labs.mlrg.olcut.util.Pair<Double,SGDVector> valueAndGradient(int truth, SGDVector prediction)
      Deprecated.
      Scores a prediction, returning the loss and a vector of per label gradients.
      Parameters:
      truth - The true label id.
      prediction - The prediction for each label id.
      Returns:
      The score and per label gradient.
    • lossAndGradient

      default com.oracle.labs.mlrg.olcut.util.Pair<Double,SGDVector> lossAndGradient(Integer truth, SGDVector prediction)
      Description copied from interface: SGDObjective
      Scores a prediction, returning the loss and a vector of per output dimension gradients.
      Specified by:
      lossAndGradient in interface SGDObjective<Integer>
      Parameters:
      truth - The true output.
      prediction - The prediction for each dimension.
      Returns:
      The score and per dimension gradient.
    • getNormalizer

      VectorNormalizer getNormalizer()
      Generates a new VectorNormalizer which normalizes the predictions into [0,1].
      Returns:
      The vector normalizer for this objective.
    • isProbabilistic

      boolean isProbabilistic()
      Does the objective function score probabilities or not?
      Returns:
      boolean.