jsat.lossfunctions
Class SoftmaxLoss
- java.lang.Object
-
- jsat.lossfunctions.LogisticLoss
-
- jsat.lossfunctions.SoftmaxLoss
-
public class SoftmaxLoss extends LogisticLoss implements LossMC
The Softmax loss function is a multi-class generalization of theLogistic loss.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description SoftmaxLoss()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidderiv(Vec processed, Vec derivs, int y)Computes the derivatives with respect to each output
processedandderivsmay be the same object, and will simply have all its values altered if so.CategoricalResultsgetClassification(Vec processed)Given theprocessedpredictions, returns the classification results for said predictions.doublegetLoss(Vec processed, int y)Computes the scalar loss for on the given examplevoidprocess(Vec pred, Vec processed)Given the vector of raw outputs for each class, transform it into a new vector.-
Methods inherited from class jsat.lossfunctions.LogisticLoss
classify, clone, deriv, deriv2, getClassification, getConjugate, getDeriv, getDeriv2, getDeriv2Max, getLoss, lipschitz, loss
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jsat.lossfunctions.LossC
clone, getClassification, getDeriv, getDeriv2, getLoss
-
Methods inherited from interface jsat.lossfunctions.LossFunc
getConjugate, getDeriv2Max, lipschitz
-
-
-
-
Method Detail
-
getLoss
public double getLoss(Vec processed, int y)
Description copied from interface:LossMCComputes the scalar loss for on the given example
-
process
public void process(Vec pred, Vec processed)
Description copied from interface:LossMCGiven the vector of raw outputs for each class, transform it into a new vector.
processedandderivsmay be the same object, and will simply have all its values altered if so.
-
deriv
public void deriv(Vec processed, Vec derivs, int y)
Description copied from interface:LossMCComputes the derivatives with respect to each output
processedandderivsmay be the same object, and will simply have all its values altered if so.
-
getClassification
public CategoricalResults getClassification(Vec processed)
Description copied from interface:LossMCGiven theprocessedpredictions, returns the classification results for said predictions.- Specified by:
getClassificationin interfaceLossMC- Parameters:
processed- the processed score/prediction vector- Returns:
- the classification results
-
-
DataMelt 3.0 © DataMelt by jWork.ORG