org.encog.neural.pattern
Class HopfieldPattern
- java.lang.Object
-
- org.encog.neural.pattern.HopfieldPattern
-
- All Implemented Interfaces:
- NeuralNetworkPattern
public class HopfieldPattern extends java.lang.Object implements NeuralNetworkPattern
Create a Hopfield pattern. A Hopfield neural network has a single layer that functions both as the input and output layers. There are no hidden layers. Hopfield networks are used for basic pattern recognition. When a Hopfield network recognizes a pattern, it "echos" that pattern on the output.
-
-
Constructor Summary
Constructors Constructor and Description HopfieldPattern()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddHiddenLayer(int count)Add a hidden layer.voidclear()Nothing to clear.MLMethodgenerate()Generate the Hopfield neural network.voidsetActivationFunction(ActivationFunction activation)Set the activation function to use.voidsetInputNeurons(int count)Set the number of input neurons, this must match the output neurons.voidsetOutputNeurons(int count)Set the number of output neurons, should not be used with a hopfield neural network, because the number of input neurons defines the number of output neurons.
-
-
-
Method Detail
-
addHiddenLayer
public void addHiddenLayer(int count)
Add a hidden layer. This will throw an error, because the Hopfield neural network has no hidden layers.- Specified by:
addHiddenLayerin interfaceNeuralNetworkPattern- Parameters:
count- The number of neurons.
-
clear
public void clear()
Nothing to clear.- Specified by:
clearin interfaceNeuralNetworkPattern
-
generate
public MLMethod generate()
Generate the Hopfield neural network.- Specified by:
generatein interfaceNeuralNetworkPattern- Returns:
- The generated network.
-
setActivationFunction
public void setActivationFunction(ActivationFunction activation)
Set the activation function to use. This function will throw an error, because the Hopfield network must use the BiPolar activation function.- Specified by:
setActivationFunctionin interfaceNeuralNetworkPattern- Parameters:
activation- The activation function to use.
-
setInputNeurons
public void setInputNeurons(int count)
Set the number of input neurons, this must match the output neurons.- Specified by:
setInputNeuronsin interfaceNeuralNetworkPattern- Parameters:
count- The number of neurons.
-
setOutputNeurons
public void setOutputNeurons(int count)
Set the number of output neurons, should not be used with a hopfield neural network, because the number of input neurons defines the number of output neurons.- Specified by:
setOutputNeuronsin interfaceNeuralNetworkPattern- Parameters:
count- The number of neurons.
-
-
DMelt 3.0 © DataMelt by jWork.ORG