public class CrossEntropyLoss extends Object implements LossFunction, Serializable
Constructor and Description |
---|
CrossEntropyLoss(int layerWidth) |
CrossEntropyLoss(NeuralNetwork neuralNet) |
Modifier and Type | Method and Description |
---|---|
float[] |
addPatternError(float[] actualOutput,
float[] targetOutput)
Calculates and returns error vector for specified actual and target outputs.
|
void |
addRegularizationSum(float regSum)
Adds specified regularization sum to total loss.
|
float |
getTotal()
Returns the total error calculated by this loss function.
|
void |
reset()
Resets the total error and pattern counter.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
valueFor
public CrossEntropyLoss(NeuralNetwork neuralNet)
public CrossEntropyLoss(int layerWidth)
public float[] addPatternError(float[] actualOutput, float[] targetOutput)
addPatternError
in interface LossFunction
actualOutput
- actual output from the neural networktargetOutput
- target/desired output of the neural networkpublic void addRegularizationSum(float regSum)
LossFunction
addRegularizationSum
in interface LossFunction
regSum
- regularization sumpublic float getTotal()
LossFunction
getTotal
in interface LossFunction
public void reset()
LossFunction
reset
in interface LossFunction
Copyright © 2022. All rights reserved.