|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.neuroph.core.Layer
public class Layer
Layer of neurons in a neural network. The Layer is basic neuron container (a collection of neurons), and it provides methods for manipulating neurons (add, remove, get, set, calculate, randomize).
Neuron
,
Serialized FormField Summary | |
---|---|
protected Neuron[] |
neurons
Array of neurons (Neuron instances) |
Constructor Summary | |
---|---|
Layer()
Creates an instance of empty Layer |
|
Layer(int neuronsCount,
NeuronProperties neuronProperties)
Creates an instance of Layer with the specified number of neurons with specified neuron properties |
Method Summary | |
---|---|
void |
addNeuron(int index,
Neuron neuron)
Adds specified neuron to this layer,at specified index position |
void |
addNeuron(Neuron neuron)
Adds specified neuron to this layer |
void |
calculate()
Performs calculaton for all neurons in this layer |
String |
getLabel()
Get layer label |
Neuron |
getNeuronAt(int index)
Returns neuron at specified index position in this layer |
Neuron[] |
getNeurons()
Returns array of neurons in this layer |
int |
getNeuronsCount()
Returns number of neurons in this layer |
NeuralNetwork |
getParentNetwork()
Returns reference to parent network |
int |
indexOf(Neuron neuron)
Returns the index position in layer for the specified neuron |
void |
initializeWeights(double value)
Initialize connection weights for the whole layer to to specified value |
void |
randomizeWeights()
Randomize input connection weights for all neurons in this layer |
void |
randomizeWeights(double minWeight,
double maxWeight)
Randomize input connection weights for all neurons in this layer within specified value range |
void |
randomizeWeights(Random generator)
Initialize connection weights for all neurons in this layer using a random number generator |
void |
removeAllNeurons()
|
void |
removeNeuron(Neuron neuron)
Removes neuron from layer |
void |
removeNeuronAt(int index)
Removes neuron at specified index position in this layer |
void |
reset()
Resets the activation and input levels for all neurons in this layer |
void |
setLabel(String label)
Set layer label |
void |
setNeuron(int index,
Neuron neuron)
Sets (replace) the neuron at specified position in layer |
void |
setParentNetwork(NeuralNetwork parent)
Sets reference on parent network |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Neuron[] neurons
Constructor Detail |
---|
public Layer()
public Layer(int neuronsCount, NeuronProperties neuronProperties)
neuronsCount
- number of neurons in layerneuronProperties
- properties of neurons in layerMethod Detail |
---|
public void setParentNetwork(NeuralNetwork parent)
parent
- parent networkpublic NeuralNetwork getParentNetwork()
public final Neuron[] getNeurons()
public final void addNeuron(Neuron neuron)
neuron
- neuron to addpublic final void addNeuron(int index, Neuron neuron)
neuron
- neuron to addindex
- index position at which neuron should be addedpublic void setNeuron(int index, Neuron neuron)
index
- index position to set/replaceneuron
- new Neuron object to setpublic void removeNeuron(Neuron neuron)
neuron
- neuron to removepublic void removeNeuronAt(int index)
index
- index position of neuron to removepublic void removeAllNeurons()
public Neuron getNeuronAt(int index)
index
- neuron index position
public int indexOf(Neuron neuron)
neuron
- neuron object
public int getNeuronsCount()
public void calculate()
public void reset()
public void randomizeWeights()
public void randomizeWeights(double minWeight, double maxWeight)
public void randomizeWeights(Random generator)
generator
- the random number generatorpublic void initializeWeights(double value)
value
- the weight valuepublic String getLabel()
public void setLabel(String label)
label
- layer label to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |