Class Metric

  • All Implemented Interfaces:
    java.io.Serializable
    Direct Known Subclasses:
    Accuracy, Loss

    public abstract class Metric
    extends java.lang.Object
    implements java.io.Serializable
    Class for a metric.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      Metric()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract java.lang.String getFormatString()
      Get the string to format the metric.
      abstract double getMetric​(java.util.ArrayList<Matrix> output, java.util.ArrayList<Matrix> expected)
      Get the value of the metric.
      double getMetric​(Matrix out, Matrix y)
      Get the value of the metric.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Metric

        public Metric()
    • Method Detail

      • getMetric

        public abstract double getMetric​(java.util.ArrayList<Matrix> output,
                                         java.util.ArrayList<Matrix> expected)
        Get the value of the metric.
        Parameters:
        output - output of network
        expected - expected output
        Returns:
        the metric value
      • getFormatString

        public abstract java.lang.String getFormatString()
        Get the string to format the metric.

        Return a string that can be used with printf in conjunction with the metric.
        Example: "M: %.2f"

        Returns:
        the string
      • getMetric

        public double getMetric​(Matrix out,
                                Matrix y)
        Get the value of the metric.
        Parameters:
        out - output of network
        y - expected output
        Returns:
        the metric value