|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.encog.neural.networks.layers.BasicLayer
org.encog.neural.networks.layers.ContextLayer
public class ContextLayer
Implements a context layer. A context layer is used to implement a simple recurrent neural network, such as an Elman or Jordan neural network. The context layer has a short-term memory. The context layer accept input, and provide the same data as output on the next cycle. This continues, and the context layer's output "one step" out of sync with the input.
| Field Summary | |
|---|---|
static String |
ERROR
|
| Constructor Summary | |
|---|---|
ContextLayer()
Default constructor, mainly so the workbench can easily create a default layer. |
|
ContextLayer(ActivationFunction activationFunction,
int neuronCount)
Construct a context layer with the parameters specified. |
|
ContextLayer(int neuronCount)
Construct a default context layer that has the TANH activation function and the specified number of neurons. |
|
| Method Summary | |
|---|---|
void |
clearContext()
Reset the context values back to zero. |
Persistor |
createPersistor()
Create a persistor for this layer. |
double |
getBiasWeight(int index)
Get one weight bias value. |
double[] |
getBiasWeights()
|
NeuralData |
getContext()
|
int |
getFlatContextIndex()
|
void |
process(NeuralData pattern)
Called to process input from the previous layer. |
NeuralData |
recur()
Called to get the output from this layer when called in a recurrent manor. |
void |
setBiasWeight(int index,
double d)
Set a bias weight. |
void |
setBiasWeights(double[] d)
Set the bias weights. |
void |
setFlatContextIndex(int flatContextIndex)
Set the flat context index. |
| Methods inherited from class org.encog.neural.networks.layers.BasicLayer |
|---|
addNext, addNext, addSynapse, compareTo, compute, getActivationFunction, getBiasActivation, getCollection, getDescription, getID, getName, getNetwork, getNeuronCount, getNext, getNextLayers, getX, getY, hasBias, isConnectedTo, isSelfConnected, setActivationFunction, setBiasActivation, setCollection, setDescription, setID, setName, setNetwork, setNeuronCount, setX, setY, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String ERROR
| Constructor Detail |
|---|
public ContextLayer()
public ContextLayer(ActivationFunction activationFunction,
int neuronCount)
activationFunction - The activation function to use.neuronCount - The neuron count to use.public ContextLayer(int neuronCount)
neuronCount - The number of neurons on this layer.| Method Detail |
|---|
public Persistor createPersistor()
createPersistor in interface EncogPersistedObjectcreatePersistor in class BasicLayerpublic NeuralData getContext()
public void process(NeuralData pattern)
process in interface Layerprocess in class BasicLayerpattern - The pattern to store in the context.public NeuralData recur()
recur in interface Layerrecur in class BasicLayerpublic void clearContext()
clearContext in interface ContextClearablepublic double[] getBiasWeights()
getBiasWeights in interface LayergetBiasWeights in class BasicLayerpublic double getBiasWeight(int index)
getBiasWeight in interface LayergetBiasWeight in class BasicLayerindex - The index to get.
public void setBiasWeights(double[] d)
setBiasWeights in interface LayersetBiasWeights in class BasicLayerd - The bias weights.
public void setBiasWeight(int index,
double d)
setBiasWeight in interface LayersetBiasWeight in class BasicLayerindex - The index of the value to set.d - The new value.public int getFlatContextIndex()
public void setFlatContextIndex(int flatContextIndex)
flatContextIndex - The index, in the flat network, where the context is stored.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||