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>
All Known Implementing Classes:
Hinge, LogMulticlass

public interface LabelObjective extends com.oracle.labs.mlrg.olcut.config.Configurable, com.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>
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 Summary

    Modifier and Type
    Method
    Description
    Generates a new VectorNormalizer which normalizes the predictions into [0,1].
    boolean
    Does the objective function score probabilities or not?
    com.oracle.labs.mlrg.olcut.util.Pair<Double, SGDVector>
    valueAndGradient(int truth, SGDVector prediction)
    Scores a prediction, returning the loss and a vector of per label gradients.

    Methods inherited from interface com.oracle.labs.mlrg.olcut.config.Configurable

    postConfig

    Methods inherited from interface com.oracle.labs.mlrg.olcut.provenance.Provenancable

    getProvenance
  • Method Details

    • valueAndGradient

      com.oracle.labs.mlrg.olcut.util.Pair<Double, SGDVector> valueAndGradient(int truth, SGDVector prediction)
      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.
    • 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.