Class SquaredLoss
java.lang.Object
org.tribuo.regression.sgd.objectives.SquaredLoss
- All Implemented Interfaces:
com.oracle.labs.mlrg.olcut.config.Configurable,com.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>,SGDObjective<DenseVector>,RegressionObjective
Squared loss, i.e., l2.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenanceloss(DenseVector truth, SGDVector prediction) Deprecated.lossAndGradient(DenseVector truth, SGDVector prediction) Scores a prediction, returning the loss and a vector of per output dimension gradients.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.oracle.labs.mlrg.olcut.config.Configurable
postConfig
-
Constructor Details
-
SquaredLoss
public SquaredLoss()Constructs a SquaredLoss.
-
-
Method Details
-
loss
@Deprecated public com.oracle.labs.mlrg.olcut.util.Pair<Double, SGDVector> loss(DenseVector truth, SGDVector prediction) Deprecated.Description copied from interface:RegressionObjectiveScores a prediction, returning the loss.- Specified by:
lossin interfaceRegressionObjective- Parameters:
truth- The true regression value.prediction- The predicted regression value.- Returns:
- A pair with the loss and gradient.
-
lossAndGradient
public com.oracle.labs.mlrg.olcut.util.Pair<Double, SGDVector> lossAndGradient(DenseVector truth, SGDVector prediction) Description copied from interface:SGDObjectiveScores a prediction, returning the loss and a vector of per output dimension gradients.- Specified by:
lossAndGradientin interfaceRegressionObjective- Specified by:
lossAndGradientin interfaceSGDObjective<DenseVector>- Parameters:
truth- The true output.prediction- The prediction for each dimension.- Returns:
- The score and per dimension gradient.
-
toString
-
getProvenance
public com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance getProvenance()- Specified by:
getProvenancein interfacecom.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>
-