Is it possible to implement a Hopfield network through Keras, or even TensorFlow? Something like newhop
in MATLAB
?
The Hopfield Neural Networks, invented by Dr John J. Hopfield consists of one layer of 'n' fully connected recurrent neurons. It is generally used in performing auto association and optimization tasks.
According to Wikipedia: "The Hopfield network is an RNN in which all connections are symmetric." Other types of RNN that are not Hopfield networks are: Fully reconnect, recursive, Elman, Jordan and more.
One of the major shortcomings of Hopfield neural network (HNN) is that the network may not always converge to a fixed point. HNN, predominantly, is limited to local optimization during training to achieve network stability.
The learning algorithm of the Hopfield network is unsupervised, meaning that there is no “teacher” telling the network what is the correct output for a certain input.
Here is a simple numpy implementation of a Hopfield Network applying the Hebbian learning rule to reconstruct letters after noise has been added:
https://github.com/CCD-1997/hello_nn/tree/master/Hopfield-Network
Depending on your particular use case, there is the general Recurrent Neural Network architecture support in Tensorflow, mainly geared towards language modelling. Additionally, Keras offers RNN support too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With