Package com.jml.losses
Class LossFunctions
java.lang.Object
com.jml.losses.LossFunctions
This class contains lambda functions for various loss functions including:
- sse: sum of squared-errors loss.
- binCrossEntropy: binary cross-entropy loss (Cross-entropy for two classes).
- crossEntropy: cross-entropy loss (For multiple classes).
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic FunctionThe binary cross-entropy loss function.static Functionthe cross-entropy loss function.static FunctionThe sum of mean squared-errors loss function.
That ismse = (1/n)*sum(xi - yi)2wherexandyare datasets of lengthn, andxis the actual data andyis the predicted data.static FunctionThe sum of squared-errors loss function.
That issse = sum(xi - yi)2wherexandyare datasets of lengthn, andxis the actual data andyis the predicted data. -
Method Summary
-
Field Details
-
mse
The sum of mean squared-errors loss function.
That ismse = (1/n)*sum(xi - yi)2wherexandyare datasets of lengthn, andxis the actual data andyis the predicted data. -
sse
The sum of squared-errors loss function.
That issse = sum(xi - yi)2wherexandyare datasets of lengthn, andxis the actual data andyis the predicted data. -
binCrossEntropy
The binary cross-entropy loss function. Note: cross-entropy is undefined for p=0 or p=1, so probabilities adjusted to be "very close" to 0 or 1 if appropriate. -
crossEntropy
the cross-entropy loss function. Note: cross-entropy is undefined for p=0 or p=1, so probabilities adjusted to be "very close" to 0 or 1 if appropriate.
-