|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.openai.ai.nn.network.Layer
This class is a container for neurons and keeps state information for this layer.
Field Summary | |
protected static int |
HIDDEN_LAYER
|
protected static int |
INPUT_LAYER
|
protected static int |
OUTPUT_LAYER
|
Constructor Summary | |
Layer()
Constructor declaration |
|
Layer(long lID)
Constructor declaration |
Method Summary | |
void |
addBias()
Add the bias neuron. |
void |
addNeuron()
Creates and adds a single neuron to the layer. |
void |
addNeuron(Neuron neuron)
Adds a single neuron to the layer. |
void |
addNeuronEventListener(NeuronEventListener listener)
Adds a neuron added event listener. |
void |
calculate()
Processes this layer, calling the input function, then the transfer function and sets all variables for the learning process to be completed. |
void |
clear()
Clears all the existing neurons. |
long |
getID()
Returns the Layer-ID |
InputFunction |
getInputFunction()
Get the value of inputFunction. |
int |
getLayerType()
Get the layer type. |
LearningRule |
getLearningRule()
Get the value of learningRule. |
java.lang.String |
getName()
Gets the name for this layer. |
Network |
getNetwork()
Returns the network which holds this layer |
Neuron |
getNeuronForID(long lID)
Get a specific Neuron by its ID |
java.util.Vector |
getNeurons()
Get the neurons for this layer. |
long |
getNextNeuronID()
Returns the next neuron ID for this layer Required for castor |
int |
getSize()
Returns the number of neurons in this layer. |
TransferFunction |
getTransferFunction()
Get the value of transferFunction. |
void |
learn(TrainingElement trainingElement)
The learning method for the layer. |
boolean |
readyToLearn()
Calls the learning rule to see if it's ready to process this layer. |
void |
removeNeuron(Neuron neuron)
|
void |
removeNeuronEventListener(NeuronEventListener listener)
Removes a neuron added event listener. |
void |
seedNeurons(java.util.Vector inputs)
Seed the neurons with input. |
void |
setID(long lID)
Sets the Layer-ID |
void |
setInputFunction(InputFunction inputFunction)
Set the value of inputFunction. |
void |
setLayerType(int layerType)
Set the layer type. |
void |
setLearningRule(LearningRule learningRule)
Set the value of learningRule. |
void |
setName(java.lang.String name)
Sets the name for this layer. |
void |
setNetwork(Network network)
Sets the network (=parent) |
void |
setNextNeuronID(long lNID)
Sets the next neuron ID for this layer Required for castor |
void |
setSize(int i)
Sets the number of neurons in this layer, this should behave much like the Vector.setSize() in that, if i > current Size, new neurons are added to the layer and if i < current Size then any neuron at index i or greater are discarded. |
void |
setTransferFunction(TransferFunction transferFunction)
Set the value of transferFunction. |
java.lang.String |
toString()
Returns a String representation of this layer. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected static final int INPUT_LAYER
protected static final int HIDDEN_LAYER
protected static final int OUTPUT_LAYER
Constructor Detail |
public Layer()
public Layer(long lID)
lID
- Method Detail |
public long getID()
public void setID(long lID)
public long getNextNeuronID()
public void setNextNeuronID(long lNID)
public void calculate()
public boolean readyToLearn()
public void learn(TrainingElement trainingElement) throws net.openai.ai.nn.network.NetworkConfigurationException
net.openai.ai.nn.network.NetworkConfigurationException
public java.util.Vector getNeurons()
public final Neuron getNeuronForID(long lID)
lID
- ID of the Neuron
public void seedNeurons(java.util.Vector inputs)
public void addBias()
public LearningRule getLearningRule()
public void setLearningRule(LearningRule learningRule)
public TransferFunction getTransferFunction()
public void setTransferFunction(TransferFunction transferFunction)
public InputFunction getInputFunction()
public void setInputFunction(InputFunction inputFunction)
public int getSize()
public void setSize(int i)
i
- The number of neurons to be held in this layer.public void addNeuron()
public void addNeuron(Neuron neuron)
public void removeNeuron(Neuron neuron)
public void clear()
public java.lang.String getName()
public void setName(java.lang.String name)
name
- The name for this layer.public int getLayerType()
public void setLayerType(int layerType)
layerType
- The type of this layer (input, hidden, output)public void addNeuronEventListener(NeuronEventListener listener)
listener
- listener to add.public void removeNeuronEventListener(NeuronEventListener listener)
listener
- listener to remove.public java.lang.String toString()
toString
in class java.lang.Object
public Network getNetwork()
public void setNetwork(Network network)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |