The Encog Project

org.encog.neural.networks.layers
Class HopfieldLayer

java.lang.Object
  extended by org.encog.neural.networks.layers.BasicLayer
      extended by org.encog.neural.networks.layers.HopfieldLayer
All Implemented Interfaces:
java.io.Serializable, Layer, EncogPersistedObject

public class HopfieldLayer
extends BasicLayer
implements EncogPersistedObject

HopfieldLayer: This class implements a Hopfield neural network. A Hopfield neural network is fully connected and consists of a single layer. Hopfield neural networks are usually used for pattern recognition.

See Also:
Serialized Form

Constructor Summary
HopfieldLayer(int size)
          Construct a hopfield layer of the specified size.
 
Method Summary
 NeuralData compute(NeuralData pattern)
          Present a pattern to the neural network and receive the result.
 Persistor createPersistor()
          Create a persistor for this layer.
 BiPolarNeuralData getFire()
          Get the output array from the last time that the output of this layer was calculated.
 void setNeuronCount(int count)
          Set the neuron count for this layer.
 
Methods inherited from class org.encog.neural.networks.layers.BasicLayer
getDescription, getFire, getMatrix, getMatrixSize, getName, getNeuronCount, getNext, getPrevious, hasMatrix, isHidden, isInput, isOutput, reset, setDescription, setFire, setFire, setMatrix, setName, setNext, setPrevious
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.encog.neural.persist.EncogPersistedObject
getDescription, getName, setDescription, setName
 

Constructor Detail

HopfieldLayer

public HopfieldLayer(int size)
Construct a hopfield layer of the specified size.

Parameters:
size - The number of neurons in this layer.
Method Detail

compute

public NeuralData compute(NeuralData pattern)
Present a pattern to the neural network and receive the result.

Specified by:
compute in interface Layer
Overrides:
compute in class BasicLayer
Parameters:
pattern - The pattern to be presented to the neural network.
Returns:
The output from the neural network.

createPersistor

public Persistor createPersistor()
Create a persistor for this layer.

Specified by:
createPersistor in interface EncogPersistedObject
Overrides:
createPersistor in class BasicLayer
Returns:
A persistor.

getFire

public BiPolarNeuralData getFire()
Description copied from class: BasicLayer
Get the output array from the last time that the output of this layer was calculated.

Specified by:
getFire in interface Layer
Overrides:
getFire in class BasicLayer
Returns:
Get the fire data.

setNeuronCount

public void setNeuronCount(int count)
Set the neuron count for this layer.

Overrides:
setNeuronCount in class BasicLayer
Parameters:
count - The neuron count.

The Encog Project