|
The Encog Project | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.encog.neural.networks.training.propagation.gradient.CalculateGradient
public class CalculateGradient
This class is used to calculate the gradients for each of the weights and thresholds values in a neural network. It is used by the propagation training methods. This class must visit every training set element. Multithreading is used to process every training set element, however it requires an indexable training set to run in multithreaded mode. Multithreaded mode allows the training method to run much faster on a multicore machine.
| Constructor Summary | |
|---|---|
CalculateGradient(BasicNetwork network,
NeuralDataSet training)
Construct the object using a network and training set. |
|
CalculateGradient(BasicNetwork network,
NeuralDataSet training,
int threads)
Construct the object for multithreaded use. |
|
| Method Summary | |
|---|---|
void |
calculate(double[] weights)
Calculate the gradients based on the specified weights. |
NeuralDataPair |
createPair()
Create a new neural data pair object of the correct size for the neural network that is being trained. |
int |
getCount()
|
double |
getError()
|
double[] |
getGradients()
|
BasicNetwork |
getNetwork()
|
double[] |
getWeights()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CalculateGradient(BasicNetwork network,
NeuralDataSet training)
network - The network to be used to calculate.training - The training set to use.
public CalculateGradient(BasicNetwork network,
NeuralDataSet training,
int threads)
network - The network to use.training - The training set to use.threads - The number of threads. Specify one for single threaded.
Specify zero to allow Encog to determine the best number of
threads to use, based on how many processors this machine has.| Method Detail |
|---|
public void calculate(double[] weights)
weights - The weights to use.public NeuralDataPair createPair()
public int getCount()
public double getError()
public double[] getGradients()
public BasicNetwork getNetwork()
public double[] getWeights()
|
The Encog Project | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||