Class StepLoss

    • Constructor Summary

      Constructors 
      Constructor Description
      StepLoss()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method 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.
      • Methods inherited from class java.lang.Object

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

      • StepLoss

        public StepLoss()
    • Method Detail

      • calculateLoss

        public double calculateLoss​(de.jungblut.math.DoubleMatrix y,
                                    de.jungblut.math.DoubleMatrix hypothesis)
        Description copied from interface: LossFunction
        Calculate the error with the given parameters.
        Specified by:
        calculateLoss in interface LossFunction
        Parameters:
        y - 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.
        Returns:
        a positive value that denotes the error between the two matrices.
      • calculateLoss

        public double calculateLoss​(de.jungblut.math.DoubleVector y,
                                    de.jungblut.math.DoubleVector hypothesis)
        Description copied from interface: LossFunction
        Calculate the error with the given parameters.
        Specified by:
        calculateLoss in interface LossFunction
        Parameters:
        y - the real outcome as a vector single example.
        hypothesis - the hypothesis as a vector single example.
        Returns:
        a positive value that denotes the error between the two vectors.
      • calculateGradient

        public de.jungblut.math.DoubleVector calculateGradient​(de.jungblut.math.DoubleVector feature,
                                                               de.jungblut.math.DoubleVector y,
                                                               de.jungblut.math.DoubleVector hypothesis)
        Description copied from interface: LossFunction
        Calculate the gradient with the given parameters.
        Specified by:
        calculateGradient in interface LossFunction
        y - the real outcome as a vector single example.
        hypothesis - the hypothesis as a vector single example.
        Returns:
        a vector that denotes the gradient given the hypothesis and real outcome.