public class Hinge extends Object implements LabelObjective
The Hinge loss does not generate a probabilistic model, and uses a NoopNormalizer
.
Constructor and Description |
---|
Hinge()
Construct a hinge objective with a margin of 1.0.
|
Hinge(double margin)
Construct a hinge objective with the supplied margin.
|
Modifier and Type | Method and Description |
---|---|
VectorNormalizer |
getNormalizer()
Returns a new
NoopNormalizer . |
com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance |
getProvenance() |
boolean |
isProbabilistic()
Returns false.
|
com.oracle.labs.mlrg.olcut.util.Pair<Double,SGDVector> |
lossAndGradient(Integer truth,
SGDVector prediction)
|
String |
toString() |
com.oracle.labs.mlrg.olcut.util.Pair<Double,SGDVector> |
valueAndGradient(int truth,
SGDVector prediction)
Deprecated.
|
public Hinge(double margin)
margin
- The margin to use.public Hinge()
@Deprecated public com.oracle.labs.mlrg.olcut.util.Pair<Double,SGDVector> valueAndGradient(int truth, SGDVector prediction)
LabelObjective
valueAndGradient
in interface LabelObjective
truth
- The true label id.prediction
- The prediction for each label id.public com.oracle.labs.mlrg.olcut.util.Pair<Double,SGDVector> lossAndGradient(Integer truth, SGDVector prediction)
lossAndGradient
in interface LabelObjective
lossAndGradient
in interface SGDObjective<Integer>
truth
- The true label id.prediction
- The prediction for each label id.public VectorNormalizer getNormalizer()
NoopNormalizer
.getNormalizer
in interface LabelObjective
public boolean isProbabilistic()
isProbabilistic
in interface LabelObjective
public com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance getProvenance()
getProvenance
in interface com.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>
Copyright © 2015–2021 Oracle and/or its affiliates. All rights reserved.