Package me.yixqiao.jlearn.losses
Class Loss
- java.lang.Object
-
- me.yixqiao.jlearn.metrics.Metric
-
- me.yixqiao.jlearn.losses.Loss
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
CrossEntropy,MeanSquaredError
public abstract class Loss extends Metric implements java.io.Serializable
Class for loss function.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Loss()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetFormatString()Get the string to format the metric.abstract doublegetLoss(java.util.ArrayList<Matrix> out, java.util.ArrayList<Matrix> y)Get the loss.doublegetLoss(Matrix out, Matrix y)Get the loss.doublegetMetric(java.util.ArrayList<Matrix> output, java.util.ArrayList<Matrix> expected)Get the value of the metric.
-
-
-
Method Detail
-
getMetric
public double getMetric(java.util.ArrayList<Matrix> output, java.util.ArrayList<Matrix> expected)
Description copied from class:MetricGet the value of the metric.
-
getFormatString
public java.lang.String getFormatString()
Description copied from class:MetricGet the string to format the metric.Return a string that can be used with printf in conjunction with the metric.
Example:"M: %.2f"- Specified by:
getFormatStringin classMetric- Returns:
- the string
-
getLoss
public abstract double getLoss(java.util.ArrayList<Matrix> out, java.util.ArrayList<Matrix> y)
Get the loss.- Parameters:
out- output of networky- correct output- Returns:
- the loss
-
-