|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.generation5.nn.NeuralNetwork
org.generation5.nn.PerceptronNN
An implementation of a perceptron.
| Field Summary | |
protected int |
correctlyClassified
The number of correctly |
protected double |
learningRate
The learning rate. |
protected double[] |
weights
The weights for the inputs. |
| Fields inherited from class org.generation5.nn.NeuralNetwork |
activation, visualization |
| Constructor Summary | |
PerceptronNN(int numInputs)
Create a new instance of the Perceptron with the given number of inputs. |
|
| Method Summary | |
protected double |
calculateNet(double[] inputs)
Calculate the sum of the weighted inputs. |
int |
getCorrectlyClassified()
Return the number of correctly classified training instances. |
int |
getCorrectlyClassified(boolean resetOnCall)
Return the number of correctly classified training instances. |
double |
getWeight(int i)
Return the perceptron weight at the given index. |
void |
initialize()
Initialize the perceptron. |
static void |
main(java.lang.String[] args)
A simple test perceptron that learns the logic-OR gate. |
double |
run(double[] inputData)
Run the network on the given set of inputs. |
double |
train(double[] inputData,
double[] expectedOutput)
Train the perceptron using the delta rule. |
| Methods inherited from class org.generation5.nn.NeuralNetwork |
getVisualization, render, setActivation, setVisualization, train, train, writeImage |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected double[] weights
protected double learningRate
protected int correctlyClassified
| Constructor Detail |
public PerceptronNN(int numInputs)
numInputs - the number of inputs.| Method Detail |
public static void main(java.lang.String[] args)
args - the command line argumentsprotected double calculateNet(double[] inputs)
inputs - the inputs.
public double run(double[] inputData)
run in class NeuralNetworkinputData - the input data.
public void initialize()
initialize in class NeuralNetwork
public double train(double[] inputData,
double[] expectedOutput)
train in class NeuralNetworkinputData - the input data.expectedOutput - the expected output.
public int getCorrectlyClassified()
return getCorrectlyClassified(true);
getCorrectlyClassified(boolean)public int getCorrectlyClassified(boolean resetOnCall)
resetOnCall - should correclyClassified be reset to zero after the method is called?
public double getWeight(int i)
i - the index of the weight to return.
|
This documentation is part of the Generation5 JDK.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||