Package libai.nn.unsupervised
Class Hopfield
- java.lang.Object
-
- libai.nn.NeuralNetwork
-
- libai.nn.unsupervised.UnsupervisedLearning
-
- libai.nn.unsupervised.Hopfield
-
- All Implemented Interfaces:
java.io.Serializable
public class Hopfield extends UnsupervisedLearning
Hopfield's networks are the most important and most applicable recurrent neural network. This Hopfield networks uses an deterministic unsupervised training algorithm and a bipolar encoding for the training patterns and answers. As the Hebb network this network is a associative memory. The main goal of this network is memorize and retrieve the memorized patterns without noise.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static SymmetricSignssignprotected MatrixW-
Fields inherited from class libai.nn.NeuralNetwork
plotter, progress, random
-
-
Constructor Summary
Constructors Constructor Description Hopfield(int inputs)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Columnsimulate(Column pattern)Calculates the output for thepattern.voidsimulate(Column pattern, Column result)Calculates the output for thepatternand left the result inresult.voidtrain(Column[] patterns, double alpha, int epochs, int offset, int length)Train the network.-
Methods inherited from class libai.nn.NeuralNetwork
error, error, euclideanDistance2, euclideanDistance2, gaussian, getDefaultRandomGenerator, getPlotter, getProgressBar, initializeProgressBar, open, open, open, save, setPlotter, setProgressBar, train, train
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from class libai.nn.unsupervised.UnsupervisedLearning
train, validatePreconditions
-
-
-
-
Field Detail
-
ssign
protected static final SymmetricSign ssign
-
W
protected final Matrix W
-
-
Method Detail
-
train
public void train(Column[] patterns, double alpha, int epochs, int offset, int length)
Train the network. The answers, alpha, epochs and minerror are meaningless in this algorithm.- Specified by:
trainin classUnsupervisedLearning- Parameters:
patterns- The patterns to be learned.alpha- The learning rate. [ignored]epochs- The maximum number of iterations. [ignored]offset- The first pattern position.length- How many patterns will be used.
-
simulate
public Column simulate(Column pattern)
Description copied from class:NeuralNetworkCalculates the output for thepattern.- Specified by:
simulatein classNeuralNetwork- Parameters:
pattern- Pattern to use as input.- Returns:
- The output for the neural network.
-
simulate
public void simulate(Column pattern, Column result)
Description copied from class:NeuralNetworkCalculates the output for thepatternand left the result inresult.- Specified by:
simulatein classNeuralNetwork- Parameters:
pattern- Pattern to use as input.result- The output for the input.
-
-