com.huguesjohnson.jail.neuralNetwork
Class NeuralNetwork

java.lang.Object
  |
  +--com.huguesjohnson.jail.neuralNetwork.NeuralNetwork
All Implemented Interfaces:
java.lang.Runnable, java.io.Serializable
Direct Known Subclasses:
BackPropagationNetwork

public abstract class NeuralNetwork
extends java.lang.Object
implements java.lang.Runnable, java.io.Serializable

class NeuralNetwork, base class for neural network objects contains a functionality that is common to all neural networks

See Also:
Serialized Form

Constructor Summary
NeuralNetwork()
          default constructor
NeuralNetwork(java.lang.String logFile)
          constructor
 
Method Summary
 void finalize()
          destructor
abstract  double getError()
          returns the error for the network
abstract  double[] getOutput()
          returns the output for the network
protected  void log(java.lang.String line)
          append a line to the log file
 void run()
          run the neural network
abstract  void setDesiredOutput(double[] desiredOutput)
          sets the desired output of the network
abstract  void setInput(double[] input)
          sets the input to the network
 void start()
          begins thread execution
 void stop()
          stops thread execution
 java.lang.String toString()
          returns a string representation of the object
abstract  void train(int iterations)
          train the network
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NeuralNetwork

public NeuralNetwork()
default constructor


NeuralNetwork

public NeuralNetwork(java.lang.String logFile)
constructor

Parameters:
logFile - path to log file
Method Detail

finalize

public void finalize()
destructor

Overrides:
finalize in class java.lang.Object

log

protected final void log(java.lang.String line)
append a line to the log file

Parameters:
line - the line to append

start

public void start()
begins thread execution


stop

public void stop()
stops thread execution


run

public void run()
run the neural network

Specified by:
run in interface java.lang.Runnable

toString

public java.lang.String toString()
returns a string representation of the object

Overrides:
toString in class java.lang.Object
Returns:
string representation of the object

train

public abstract void train(int iterations)
train the network

Parameters:
iterations - the number of training iterations to run

getError

public abstract double getError()
returns the error for the network

Returns:
error for the network

getOutput

public abstract double[] getOutput()
returns the output for the network

Returns:
output for the network

setInput

public abstract void setInput(double[] input)
sets the input to the network

Parameters:
input - the input to the network

setDesiredOutput

public abstract void setDesiredOutput(double[] desiredOutput)
sets the desired output of the network

Parameters:
desiredOutput - the desired output of the network