|
The Encog Project | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.encog.neural.networks.layers.BasicLayer
public class BasicLayer
Basic functionality that most of the neural layers require. The basic layer is often used by itself to implement forward or recurrent layers. Other layer types are based on the basic layer as well. The layer will either have thresholds are not. Thresholds are values that correspond to each of the neurons. The threshold values will be added to the output calculated for each neuron. Together with the weight matrix the threshold values make up the memory of the neural network. When the neural network is trained, these threshold values (along with the weight matrix values) will be modified.
| Constructor Summary | |
|---|---|
BasicLayer()
Default constructor, mainly so the workbench can easily create a default layer. |
|
BasicLayer(ActivationFunction activationFunction,
boolean hasThreshold,
int neuronCount)
Construct this layer with a non-default threshold function. |
|
BasicLayer(int neuronCount)
Construct this layer with a sigmoid threshold function. |
|
| Method Summary | |
|---|---|
void |
addNext(Layer next)
Add a layer as the next layer. |
void |
addNext(Layer next,
SynapseType type)
Add a layer to this layer. |
void |
addSynapse(Synapse synapse)
Add a synapse to the list of outbound synapses. |
java.lang.Object |
clone()
Clone this object. |
NeuralData |
compute(NeuralData pattern)
Compute the outputs for this layer given the input pattern. |
Persistor |
createPersistor()
Create a persistor for this layer. |
ActivationFunction |
getActivationFunction()
|
java.lang.String |
getDescription()
|
java.lang.String |
getName()
|
int |
getNeuronCount()
Get the neuron count for this layer. |
java.util.List<Synapse> |
getNext()
Get a list of all of the outbound synapse connections from this layer. |
java.util.Collection<Layer> |
getNextLayers()
|
double[] |
getThreshold()
|
double |
getThreshold(int index)
Get an individual threshold value. |
int |
getX()
|
int |
getY()
|
boolean |
hasThreshold()
|
boolean |
isConnectedTo(Layer layer)
Determine if this layer is connected to another layer. |
boolean |
isSelfConnected()
|
void |
process(NeuralData pattern)
Process the input pattern. |
NeuralData |
recur()
Get the output from this layer when called in a recurrent manor. |
void |
setActivationFunction(ActivationFunction f)
Set the activation function for this layer. |
void |
setDescription(java.lang.String description)
Set the description of this object. |
void |
setName(java.lang.String name)
Set the name of this object. |
void |
setNeuronCount(int neuronCount)
Set the neuron count. |
void |
setThreshold(double[] d)
Set the threshold array. |
void |
setThreshold(int index,
double d)
Set the specified threshold value. |
void |
setX(int x)
Set the x coordinate for this layer. |
void |
setY(int y)
Set the y coordinate for this layer. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public BasicLayer()
public BasicLayer(ActivationFunction activationFunction,
boolean hasThreshold,
int neuronCount)
activationFunction - The threshold function to use.neuronCount - How many neurons in this layer.hasThreshold - True if this layer has threshold values.public BasicLayer(int neuronCount)
neuronCount - How many neurons in this layer.| Method Detail |
|---|
public void addNext(Layer next)
addNext in interface Layernext - THe next layer.
public void addNext(Layer next,
SynapseType type)
Layer
addNext in interface Layernext - The next layer to add.type - The synapse type to use for this layer.public void addSynapse(Synapse synapse)
addSynapse in interface Layersynapse - The synapse to add.public java.lang.Object clone()
clone in interface Layerclone in interface EncogPersistedObjectclone in class java.lang.Objectpublic NeuralData compute(NeuralData pattern)
compute in interface Layerpattern - The input pattern.
public Persistor createPersistor()
createPersistor in interface EncogPersistedObjectpublic ActivationFunction getActivationFunction()
getActivationFunction in interface Layerpublic java.lang.String getDescription()
getDescription in interface EncogPersistedObjectpublic java.lang.String getName()
getName in interface EncogPersistedObjectpublic int getNeuronCount()
getNeuronCount in interface Layerpublic java.util.List<Synapse> getNext()
Layer
getNext in interface Layerpublic java.util.Collection<Layer> getNextLayers()
getNextLayers in interface Layerpublic double[] getThreshold()
getThreshold in interface Layerpublic double getThreshold(int index)
getThreshold in interface Layerindex - The threshold value to get.
public int getX()
getX in interface Layerpublic int getY()
getY in interface Layerpublic boolean hasThreshold()
hasThreshold in interface Layerpublic boolean isConnectedTo(Layer layer)
isConnectedTo in interface Layerlayer - A layer to check and see if this layer is connected to.
public boolean isSelfConnected()
public void process(NeuralData pattern)
process in interface Layerpattern - The input to this layer.public NeuralData recur()
recur in interface Layerpublic void setActivationFunction(ActivationFunction f)
setActivationFunction in interface Layerf - The activation function.public void setDescription(java.lang.String description)
EncogPersistedObject
setDescription in interface EncogPersistedObjectdescription - the description to setpublic void setName(java.lang.String name)
EncogPersistedObject
setName in interface EncogPersistedObjectname - the name to setpublic void setNeuronCount(int neuronCount)
setNeuronCount in interface LayerneuronCount - The new neuron count.public void setThreshold(double[] d)
setThreshold in interface Layerd - The new threshold array.
public void setThreshold(int index,
double d)
setThreshold in interface Layerindex - The threshold value to set.d - The value to set the threshold to.public void setX(int x)
setX in interface Layerx - The x-coordinate.public void setY(int y)
setY in interface Layery - The y-coordinate.public java.lang.String toString()
toString in class java.lang.Object
|
The Encog Project | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||