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
Modifier and TypeFieldDescriptionstatic Function
The binary cross-entropy loss function.static Function
the cross-entropy loss function.static Function
The sum of mean squared-errors loss function.
That ismse = (1/n)*sum(xi - yi)2
wherex
andy
are datasets of lengthn
, andx
is the actual data andy
is the predicted data.static Function
The sum of squared-errors loss function.
That issse = sum(xi - yi)2
wherex
andy
are datasets of length
n
, andx
is the actual data andy
is the predicted data. -
Method Summary
-
Field Details
-
mse
The sum of mean squared-errors loss function.
That ismse = (1/n)*sum(xi - yi)2
wherex
andy
are datasets of lengthn
, andx
is the actual data andy
is the predicted data. -
sse
The sum of squared-errors loss function.
That issse = sum(xi - yi)2
wherex
andy
are datasets of length
n
, andx
is the actual data andy
is 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.
-