|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.generation5.nn.NeuralNetwork
A neural network framework class. The class is meant to help create simple neural networks, such as perceptrons and self-organizing networks.
| Field Summary | |
protected Activation |
activation
The activation function. |
protected Visualizable |
visualization
Allows for a visualizer to be assigned to a neural network. |
| Constructor Summary | |
NeuralNetwork()
|
|
| Method Summary | |
Visualizable |
getVisualization()
Return the current visualization. |
abstract void |
initialize()
Initialize the neural network. |
void |
render(java.awt.Graphics g,
int width,
int height)
Render the neural network using the assigned visualization. |
abstract double |
run(double[] inputData)
Run the neural network on the given inputs. |
void |
setActivation(Activation ac)
Set the activation function. |
void |
setVisualization(Visualizable vis)
Set the visualization to use. |
double |
train(double[] inputData)
This method is provided as a helper for networks that have no expected output, such as unsupervised networks. |
double |
train(double[] inputData,
double expectedOutput)
This method is provided as a helper for networks that only have one output, therefore only one expected output. |
abstract double |
train(double[] inputData,
double[] expectedOutput)
Train the neural network on the given training data. |
void |
writeImage(java.lang.String s,
int width,
int height)
Write an image of the neural network using the assigned visualization. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected Visualizable visualization
protected Activation activation
| Constructor Detail |
public NeuralNetwork()
| Method Detail |
public abstract void initialize()
throws NeuralNetworkException
NeuralNetworkException - This
public abstract double train(double[] inputData,
double[] expectedOutput)
throws NeuralNetworkException
inputData - the input data.expectedOutput - the expect output.
NeuralNetworkException - if an error occurs with training, this method should throw a NeuralNetworkException.
public double train(double[] inputData,
double expectedOutput)
throws NeuralNetworkException
public double train(double[] inputData, double expectedOutput)
throws NeuralNetworkException {
return train(inputData, new double[] { expectedOutput });
}
inputData - the input data.expectedOutput - the expected output.
train(double[], double[]).
NeuralNetworkException - the exception thrown if any training errors occur.train(double[], double[])
public double train(double[] inputData)
throws NeuralNetworkException
public double train(double[] inputData) throws NeuralNetworkException {
return train(inputData, null);
}
inputData - the input data.
train(double[], double[]).
NeuralNetworkException - the exception thrown if any training errors occur.
public abstract double run(double[] inputData)
throws NeuralNetworkException
inputData - the input data.
NeuralNetworkException - an exception is thrown if an error occurs.public void setActivation(Activation ac)
ac - the activation function.
public void render(java.awt.Graphics g,
int width,
int height)
render in interface Visualizableg - the graphics context.width - the width of the graphics context.height - the height of the graphics context.
public void writeImage(java.lang.String s,
int width,
int height)
writeImage in interface Visualizables - the filename of the image to write.width - the width of the image.height - the height of the image.public Visualizable getVisualization()
public void setVisualization(Visualizable vis)
vis - the visualization class to use.
|
This documentation is part of the Generation5 JDK.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||