|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--backpropagation.Backpropagation
Implementation of the well-known backpropagation algorithm with optional number of layers.
Author: Richard Szabo
Last modification: 02/Mar/2001
Field Summary | |
double |
absoluteError
Summed absolute error on the components of the output vector. |
protected double |
calmingRate
Calming rate of the learning rate: 1.0 means constant learning rate. |
protected double |
elasticity
Elasticity of the sigmoid function. |
protected double |
elasticityRate
Changing rate of the elasticity. |
protected backpropagation.Neuron[][] |
layers
Layers of the network. |
protected double |
learningRate
Learning rate of the network. |
protected double |
momentum
Constant determining the influence of the previous weight change on the actual. |
protected int |
numberOfLayers
Number of the layers, must be at least 2. |
protected int[] |
numberOfNeurons
Number of the neurons in layers, must be at least 1. |
protected double |
theta
Threshold of the sigmoid function. |
Constructor Summary | |
protected |
Backpropagation()
Hidden constructor of the class to be used in the loadNeuro static method. |
|
Backpropagation(int numberOfLayers,
int[] numberOfNeurons)
Basic constructor. |
|
Backpropagation(int numberOfLayers,
int[] numberOfNeurons,
double learningRate,
double theta,
double elasticity,
double calmingRate,
double momentum,
double elasticityRate)
Creation of a new BackProp network with lots of parameters. |
Method Summary | |
void |
alterWeights()
Alteration of the network with Gaussian. |
protected double |
d1sigmoid(double x)
First derivative of the sigmoid function. |
double |
getCalmingRate()
Returns the calming rate. |
double |
getElasticity()
Returns the actual elasticity. |
double |
getElasticityRate()
Returns the elasticity rate. |
double |
getLearningRate()
Returns the actual learning rate. |
double |
getMomentum()
Returns the momentum. |
double |
getTheta()
Returns the theta. |
double |
hidden(int i,
int j)
Returns the output value of the jth hidden neuron in the ith layer. |
protected void |
init()
Initialization of the network with random weights. |
void |
learn(double[] input,
double[] output)
Teaches the network according to the input-output value pair. |
static Backpropagation |
loadNeuro(java.lang.String path,
java.lang.String name)
Loads a previously learned network. |
double |
output(int i)
Returns network output of a given neuron. |
void |
propagate(double[] input)
Propagates the network input to get the output. |
void |
saveNeuro(java.lang.String path,
java.lang.String name)
Saves the learned network weights. |
void |
setCalmingRate(double calmingRate)
Sets the calming rate. |
void |
setElasticity(double elasticity)
Sets the elasticity. |
void |
setElasticityRate(double elasticityRate)
Sets the elasticity rate. |
void |
setLearningRate(double learningRate)
Sets the learning rate. |
void |
setMomentum(double momentum)
Sets the momentum. |
void |
setTheta(double theta)
Sets the theta. |
protected double |
sigmoid(double x)
Sigmoid function working in the (-1,1) interval. |
java.lang.String |
toString()
String representation of the network. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
protected double learningRate
protected double theta
protected double elasticity
protected double calmingRate
protected double momentum
protected double elasticityRate
protected int numberOfLayers
protected int[] numberOfNeurons
protected backpropagation.Neuron[][] layers
public double absoluteError
Constructor Detail |
public Backpropagation(int numberOfLayers, int[] numberOfNeurons)
public Backpropagation(int numberOfLayers, int[] numberOfNeurons, double learningRate, double theta, double elasticity, double calmingRate, double momentum, double elasticityRate)
protected Backpropagation()
Method Detail |
public void propagate(double[] input)
public void learn(double[] input, double[] output)
public void alterWeights()
public void saveNeuro(java.lang.String path, java.lang.String name)
public static Backpropagation loadNeuro(java.lang.String path, java.lang.String name)
public java.lang.String toString()
public double output(int i)
public double hidden(int i, int j)
public double getLearningRate()
public void setLearningRate(double learningRate)
public double getTheta()
public void setTheta(double theta)
public double getElasticity()
public void setElasticity(double elasticity)
public double getCalmingRate()
public void setCalmingRate(double calmingRate)
public double getMomentum()
public void setMomentum(double momentum)
public double getElasticityRate()
public void setElasticityRate(double elasticityRate)
protected double sigmoid(double x)
protected double d1sigmoid(double x)
protected void init()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |