public final class CrossEntropyLoss extends Object implements LossFunction
SoftMaxActivationFunction.| Constructor and Description |
|---|
CrossEntropyLoss() |
| Modifier and Type | Method and Description |
|---|---|
de.jungblut.math.DoubleVector |
calculateGradient(de.jungblut.math.DoubleVector feature,
de.jungblut.math.DoubleVector y,
de.jungblut.math.DoubleVector hypothesis)
Calculate the gradient with the given parameters.
|
double |
calculateLoss(de.jungblut.math.DoubleMatrix y,
de.jungblut.math.DoubleMatrix hypothesis)
Calculate the error with the given parameters.
|
double |
calculateLoss(de.jungblut.math.DoubleVector y,
de.jungblut.math.DoubleVector hypothesis)
Calculate the error with the given parameters.
|
public double calculateLoss(de.jungblut.math.DoubleMatrix y,
de.jungblut.math.DoubleMatrix hypothesis)
LossFunctioncalculateLoss in interface LossFunctiony - the real outcome as a matrix- rows contain the examples, columns
the examples' output.hypothesis - the hypothesis as a matrix- rows contain the examples,
columns the predicted output.public double calculateLoss(de.jungblut.math.DoubleVector y,
de.jungblut.math.DoubleVector hypothesis)
LossFunctioncalculateLoss in interface LossFunctiony - the real outcome as a vector single example.hypothesis - the hypothesis as a vector single example.public de.jungblut.math.DoubleVector calculateGradient(de.jungblut.math.DoubleVector feature,
de.jungblut.math.DoubleVector y,
de.jungblut.math.DoubleVector hypothesis)
LossFunctioncalculateGradient in interface LossFunctiony - the real outcome as a vector single example.hypothesis - the hypothesis as a vector single example.Copyright © 2016. All rights reserved.