public interface LabelObjective extends SGDObjective<Integer>
An objective knows if it generates a probabilistic model or not, and what kind of normalization needs to be applied to produce probability values.
Modifier and Type | Method and Description |
---|---|
VectorNormalizer |
getNormalizer()
Generates a new
VectorNormalizer which normalizes the predictions into [0,1]. |
boolean |
isProbabilistic()
Does the objective function score probabilities or not?
|
default com.oracle.labs.mlrg.olcut.util.Pair<Double,SGDVector> |
lossAndGradient(Integer truth,
SGDVector prediction)
Scores a prediction, returning the loss and a vector of per output dimension gradients.
|
com.oracle.labs.mlrg.olcut.util.Pair<Double,SGDVector> |
valueAndGradient(int truth,
SGDVector prediction)
Deprecated.
In 4.1, to migrate to the new name
lossAndGradient(java.lang.Integer, org.tribuo.math.la.SGDVector) . |
@Deprecated com.oracle.labs.mlrg.olcut.util.Pair<Double,SGDVector> valueAndGradient(int truth, SGDVector prediction)
lossAndGradient(java.lang.Integer, org.tribuo.math.la.SGDVector)
.truth
- The true label id.prediction
- The prediction for each label id.default com.oracle.labs.mlrg.olcut.util.Pair<Double,SGDVector> lossAndGradient(Integer truth, SGDVector prediction)
SGDObjective
lossAndGradient
in interface SGDObjective<Integer>
truth
- The true output.prediction
- The prediction for each dimension.VectorNormalizer getNormalizer()
VectorNormalizer
which normalizes the predictions into [0,1].boolean isProbabilistic()
Copyright © 2015–2021 Oracle and/or its affiliates. All rights reserved.