Package ml.shifu.guagua.example.nn
Class Gradient
- java.lang.Object
-
- ml.shifu.guagua.example.nn.Gradient
-
public class Gradient extends Object
-
-
Constructor Summary
Constructors Constructor Description 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 Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doublegetError()org.encog.mathutil.error.ErrorCalculationgetErrorCalculation()double[]getGradients()double[]getLayerDelta()org.encog.neural.flat.FlatNetworkgetNetwork()double[]getWeights()voidrun()Perform the gradient calculationvoidsetParams(org.encog.neural.networks.BasicNetwork network)voidsetWeights(double[] weights)
-
-
-
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()
-
-