public final class MeanSquaredErrorLoss extends Object implements LossFunction, Serializable
LossFunction
,
CrossEntropyLoss
,
Serialized FormConstructor and Description |
---|
MeanSquaredErrorLoss(int layerWidth) |
MeanSquaredErrorLoss(NeuralNetwork neuralNet)
Creates a new mean squared error loss for the given neural network.
|
Modifier and Type | Method and Description |
---|---|
float[] |
addPatternError(float[] predictedOutput,
float[] targetOutput)
Adds output error vector for the given predicted and target output vectors
to total error sum and returns and error vector.
|
void |
addRegularizationSum(float regSum)
Add 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 MeanSquaredErrorLoss(NeuralNetwork neuralNet)
neuralNet
- public MeanSquaredErrorLoss(int layerWidth)
public float[] addPatternError(float[] predictedOutput, float[] targetOutput)
addPatternError
in interface LossFunction
predictedOutput
- targetOutput
- public void addRegularizationSum(float regSum)
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.