|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.huguesjohnson.jail.neuralNetwork.Layer
class Layer
Constructor Summary | |
Layer()
default constructor |
Method Summary | |
void |
adjustTrainingRate(double rate)
adjusts training rates and error thresholds for every neuron in the layer values greater than 1.0 increase training rate, values between 0.0 and 1.0 decrease training rate |
void |
computeError()
computes the error of the layer (desiredOutput-actualOutput) |
abstract void |
computeOutput()
compute the output of the layer |
double[] |
getDesiredOutput()
returns the desired output of the layer |
boolean |
getDoneTraining()
returns the training status of the layer |
double |
getError()
returns the error of the layer |
com.huguesjohnson.jail.neuralNetwork.Neuron |
getNeuron(int index)
returns the neuron at the specified index in the layer |
double[] |
getOutput()
returns the output of the layer |
double |
getOutput(int index)
returns the output of a specific neuron in the layer |
int |
getSize()
returns the number of neurons in the layer |
void |
initOutput()
clears the output array |
void |
insertNeuron(int index,
com.huguesjohnson.jail.neuralNetwork.Neuron neuron)
inserts a neuron at the specified index in the layer |
void |
insertNeuron(com.huguesjohnson.jail.neuralNetwork.Neuron neuron)
inserts a neuron to the bottom of the layer |
void |
removeNeuron(int index)
removes a neuron at the specified index in the layer |
void |
run()
run the layer |
void |
runComplete()
method invoked when run is complete |
void |
setDesiredOutput(double[] desiredOutput)
sets the desired output of the layer, needed for training |
void |
setDoneTraining(boolean doneTraining)
sets the training status of the layer |
void |
setInput(double[] input)
sets the input to the layer each neuron in the layer receives the same input |
void |
setNeuron(int index,
com.huguesjohnson.jail.neuralNetwork.Neuron neuron)
sets a neuron at the specified index in the layer |
void |
setOutput(int index,
double value)
sets the output of a specific neuron in the layer |
void |
start()
begins thread execution |
void |
stop()
stops thread execution |
java.lang.String |
toString()
returns a string representation of the object |
abstract void |
train()
train the layer |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Layer()
Method Detail |
public final void setInput(double[] input)
input
- the input to the layerpublic final void setDesiredOutput(double[] desiredOutput) throws LayerException
desiredOutput
- the desired output of the layer
LayerException
- if the size of desiredOutput is not equal to the number of neurons in the layerpublic final double[] getDesiredOutput()
public final void insertNeuron(com.huguesjohnson.jail.neuralNetwork.Neuron neuron)
neuron
- the neuron to addpublic final void insertNeuron(int index, com.huguesjohnson.jail.neuralNetwork.Neuron neuron) throws LayerException
index
- the index to insert the neuron atneuron
- the neuron to add
LayerException
- if index<0 or index>=number of neurons in the layerpublic final void removeNeuron(int index) throws LayerException
index
- the index to remove the neuron from
LayerException
- if index<0 or index>=number of neurons in the layerpublic final void setNeuron(int index, com.huguesjohnson.jail.neuralNetwork.Neuron neuron) throws LayerException
index
- the index to set the neuron atneuron
- the neuron to set
LayerException
- if index<0 or index>=number of neurons in the layerpublic final com.huguesjohnson.jail.neuralNetwork.Neuron getNeuron(int index) throws LayerException
index
- the index of the neuron to return
LayerException
- if index<0 or index>=number of neurons in the layerpublic final double[] getOutput()
public final void computeError()
public final double getError()
public final int getSize()
public final double getOutput(int index) throws LayerException
index
- the index of the neuron output to return
LayerException
- if index<0 or index>=number of neurons in the layerpublic final void setOutput(int index, double value) throws LayerException
index
- the index of the neuron output to setvalue
- the new output
LayerException
- if index<0 or index>=number of neurons in the layerpublic final void initOutput()
public final boolean getDoneTraining()
public final void setDoneTraining(boolean doneTraining)
doneTraining
- set to true if the layer is done trainingpublic final void adjustTrainingRate(double rate)
rate
- the new training ratepublic void start()
public void stop()
public void run()
run
in interface java.lang.Runnable
public void runComplete()
public java.lang.String toString()
toString
in class java.lang.Object
public abstract void train()
public abstract void computeOutput()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |