Class Gradient


  • public class Gradient
    extends Object
    Gradient is copied from Encog framework. The reason is that we original Gradient don't pop up gradients outside. While we need gradients accumulated into NNMaster to update NN weights.
    • Constructor Detail

      • Gradient

        public Gradient​(org.encog.neural.flat.FlatNetwork theNetwork,
                        org.encog.ml.data.MLDataSet theTraining,
                        double[] flatSpot,
                        org.encog.neural.error.ErrorFunction ef)
        Construct a gradient worker.
    • Method Detail

      • run

        public final void run()
        Perform the gradient calculation
      • getErrorCalculation

        public org.encog.mathutil.error.ErrorCalculation getErrorCalculation()
      • getGradients

        public double[] getGradients()
        Returns:
        the gradients
      • getError

        public double getError()
        Returns:
        the error
      • getWeights

        public double[] getWeights()
        Returns:
        the weights
      • setWeights

        public void setWeights​(double[] weights)
        Parameters:
        weights - the weights to set
      • setParams

        public void setParams​(org.encog.neural.networks.BasicNetwork network)
      • getNetwork

        public org.encog.neural.flat.FlatNetwork getNetwork()
      • getLayerDelta

        public double[] getLayerDelta()