Class Losses
A loss function (or objective function, or optimization score function) is one of the two parameters required to compile a model
Implements
Inherited Members
Namespace: Keras
Assembly: Keras.dll
Syntax
public class Losses : Base, IDisposable
Methods
| Improve this Doc View SourceBinaryCrossentropy(NDarray, NDarray)
Binaries the crossentropy.
Declaration
public static NDarray BinaryCrossentropy(NDarray y_true, NDarray y_pred)
Parameters
Type | Name | Description |
---|---|---|
Numpy.NDarray | y_true | tensor of true targets. |
Numpy.NDarray | y_pred | tensor of predicted targets. |
Returns
Type | Description |
---|---|
Numpy.NDarray |
CategoricalCrossentropy(NDarray, NDarray)
Categoricals the crossentropy.
Declaration
public static NDarray CategoricalCrossentropy(NDarray y_true, NDarray y_pred)
Parameters
Type | Name | Description |
---|---|---|
Numpy.NDarray | y_true | tensor of true targets. |
Numpy.NDarray | y_pred | tensor of predicted targets. |
Returns
Type | Description |
---|---|
Numpy.NDarray |
CategoricalHinge(NDarray, NDarray)
Calculates the categorial hinge.
Declaration
public static NDarray CategoricalHinge(NDarray y_true, NDarray y_pred)
Parameters
Type | Name | Description |
---|---|---|
Numpy.NDarray | y_true | tensor of true targets. |
Numpy.NDarray | y_pred | tensor of predicted targets. |
Returns
Type | Description |
---|---|
Numpy.NDarray |
CosineProximity(NDarray, NDarray)
Cosines the proximity.
Declaration
public static NDarray CosineProximity(NDarray y_true, NDarray y_pred)
Parameters
Type | Name | Description |
---|---|---|
Numpy.NDarray | y_true | tensor of true targets. |
Numpy.NDarray | y_pred | tensor of predicted targets. |
Returns
Type | Description |
---|---|
Numpy.NDarray |
Hinge(NDarray, NDarray)
Calculates the Hinge error.
Declaration
public static NDarray Hinge(NDarray y_true, NDarray y_pred)
Parameters
Type | Name | Description |
---|---|---|
Numpy.NDarray | y_true | tensor of true targets. |
Numpy.NDarray | y_pred | tensor of predicted targets. |
Returns
Type | Description |
---|---|
Numpy.NDarray |
KullbackLeiblerDivergence(NDarray, NDarray)
Kullbacks the leibler divergence.
Declaration
public static NDarray KullbackLeiblerDivergence(NDarray y_true, NDarray y_pred)
Parameters
Type | Name | Description |
---|---|---|
Numpy.NDarray | y_true | tensor of true targets. |
Numpy.NDarray | y_pred | tensor of predicted targets. |
Returns
Type | Description |
---|---|
Numpy.NDarray |
LogCosh(NDarray, NDarray)
Logarithm of the hyperbolic cosine of the prediction error. log(cosh(x)) is approximately equal to(x** 2) / 2 for small x and to abs(x) - log(2) for large x.This means that 'logcosh' works mostly like the mean squared error, but will not be so strongly affected by the occasional wildly incorrect prediction.
Declaration
public static NDarray LogCosh(NDarray y_true, NDarray y_pred)
Parameters
Type | Name | Description |
---|---|---|
Numpy.NDarray | y_true | tensor of true targets. |
Numpy.NDarray | y_pred | tensor of predicted targets. |
Returns
Type | Description |
---|---|
Numpy.NDarray |
MeanAbsoluteError(NDarray, NDarray)
Calculates the mean absolute error.
Declaration
public static NDarray MeanAbsoluteError(NDarray y_true, NDarray y_pred)
Parameters
Type | Name | Description |
---|---|---|
Numpy.NDarray | y_true | tensor of true targets. |
Numpy.NDarray | y_pred | tensor of predicted targets. |
Returns
Type | Description |
---|---|
Numpy.NDarray |
MeanAbsolutePercentageError(NDarray, NDarray)
Calculates the mean absolute percentage error.
Declaration
public static NDarray MeanAbsolutePercentageError(NDarray y_true, NDarray y_pred)
Parameters
Type | Name | Description |
---|---|---|
Numpy.NDarray | y_true | tensor of true targets. |
Numpy.NDarray | y_pred | tensor of predicted targets. |
Returns
Type | Description |
---|---|
Numpy.NDarray |
MeanSquaredError(NDarray, NDarray)
Calculates the mean squared error.
Declaration
public static NDarray MeanSquaredError(NDarray y_true, NDarray y_pred)
Parameters
Type | Name | Description |
---|---|---|
Numpy.NDarray | y_true | tensor of true targets. |
Numpy.NDarray | y_pred | tensor of predicted targets. |
Returns
Type | Description |
---|---|
Numpy.NDarray |
MeanSquaredLogarithmicError(NDarray, NDarray)
Calculates the mean squared log error.
Declaration
public static NDarray MeanSquaredLogarithmicError(NDarray y_true, NDarray y_pred)
Parameters
Type | Name | Description |
---|---|---|
Numpy.NDarray | y_true | tensor of true targets. |
Numpy.NDarray | y_pred | tensor of predicted targets. |
Returns
Type | Description |
---|---|
Numpy.NDarray |
Poisson(NDarray, NDarray)
Poissons the specified y true.
Declaration
public static NDarray Poisson(NDarray y_true, NDarray y_pred)
Parameters
Type | Name | Description |
---|---|---|
Numpy.NDarray | y_true | tensor of true targets. |
Numpy.NDarray | y_pred | tensor of predicted targets. |
Returns
Type | Description |
---|---|
Numpy.NDarray |
SparseCategoricalCrossentropy(NDarray, NDarray)
Sparses the categorical crossentropy.
Declaration
public static NDarray SparseCategoricalCrossentropy(NDarray y_true, NDarray y_pred)
Parameters
Type | Name | Description |
---|---|---|
Numpy.NDarray | y_true | tensor of true targets. |
Numpy.NDarray | y_pred | tensor of predicted targets. |
Returns
Type | Description |
---|---|
Numpy.NDarray |
SquaredHinge(NDarray, NDarray)
Calculates the Square Hinge
Declaration
public static NDarray SquaredHinge(NDarray y_true, NDarray y_pred)
Parameters
Type | Name | Description |
---|---|---|
Numpy.NDarray | y_true | tensor of true targets. |
Numpy.NDarray | y_pred | tensor of predicted targets. |
Returns
Type | Description |
---|---|
Numpy.NDarray |