Skip to main content

Discrete Hopfield Network (DHNN) implemented with Python

Project description

DHNN

DHNN is a minimalistic and Numpy based implementation of the Discrete Hopfield Network. DHNN can learn (memorize) patterns and remember (recover) the patterns when the network feeds those with noises.

Installation

Just use pip:

pip install minisom

Or download dhnn to a directory which your choice and use setup to install script:

python setup.py install

Prerequisites

Prior to running this package, please install the following libraries.

  • numpy

Example (Image Restoration)

Step1

Input a neat picture like this(yosukekatada's smile face).

train

Step2

Get the network to memorize the pattern, this program will automatically transform RGB Jpg into black-white picture.

Step3

After the network memorized it, put the picture with noise like this(yosukekatada's smile face with sunglasses) into the network.

test

Step4

The network can strip off the sunglasses, because the network ready remembers the former picture.

recovery

Authors

yosukekatada Zeroto521
yosukekatada Zeroto521

TODO

  • more flag, add 0/1 flag or other flag.
  • optimize loop, try numba, Cpython or any other ways.
  • optimize memory.

License

MIT License. @yosukekatada, @Zeroto521

References

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dhnn-0.1.7.tar.gz (2.9 kB view details)

Uploaded Source

File details

Details for the file dhnn-0.1.7.tar.gz.

File metadata

  • Download URL: dhnn-0.1.7.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.14.2 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7

File hashes

Hashes for dhnn-0.1.7.tar.gz
Algorithm Hash digest
SHA256 044757742289f3b36822a7cec40be80c6cfd916354fe50f36a31e9d4d0523a7e
MD5 1f63f87e98bc47bde78498a7fb219889
BLAKE2b-256 dcd29e46d965bc52504fc3126bc6f3b1bcfa9c7f77fcc01ffb6187c1fc2f7bcb

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page