{"id":23465701,"url":"https://github.com/djsaunde/lm-snn","last_synced_at":"2025-04-14T11:11:20.880Z","repository":{"id":87085375,"uuid":"82091085","full_name":"djsaunde/lm-snn","owner":"djsaunde","description":"Using spiking neurons and spike-timing-dependent plasticity to classify the MNIST handwritten digits.","archived":false,"fork":false,"pushed_at":"2019-06-10T20:34:11.000Z","size":229902,"stargazers_count":157,"open_issues_count":4,"forks_count":46,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-28T00:23:06.876Z","etag":null,"topics":["brian","neural-network","python","spiking-neural-networks"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/djsaunde.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-15T18:13:45.000Z","updated_at":"2025-03-06T08:46:53.000Z","dependencies_parsed_at":"2023-06-07T22:00:41.917Z","dependency_job_id":null,"html_url":"https://github.com/djsaunde/lm-snn","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/djsaunde%2Flm-snn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/djsaunde%2Flm-snn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/djsaunde%2Flm-snn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/djsaunde%2Flm-snn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/djsaunde","download_url":"https://codeload.github.com/djsaunde/lm-snn/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248868766,"owners_count":21174758,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["brian","neural-network","python","spiking-neural-networks"],"created_at":"2024-12-24T11:30:26.841Z","updated_at":"2025-04-14T11:11:20.873Z","avatar_url":"https://github.com/djsaunde.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Unsupervised Handwritten Digit Classification using Spiking Neural Networks and Spike Timing-Dependent Plasticity\n\nThis repository contains the code for the plasticity and learning project in the BINDS laboratory at UMass Amherst.\n\nOur code is built on Peter Diehl's [research code](https://github.com/peter-u-diehl/stdp-mnist) and his work with Matthew Cook at ETH Zurich, from the paper [Unsupervised learning of digit recognition using spike-timing-dependent plasticity](http://journal.frontiersin.org/article/10.3389/fncom.2015.00099/full#).\n\n## Setting Things Up\n\nFirst things first, download the MNIST handwritten digit dataset by running the bash script entitled `get_MNIST.sh` found in the `data` folder. You can run this file by entering `./get_MNIST.sh` in the terminal; if you don't have permission to, execute `chmod +x get_MNIST.sh`.\n\n__Important__: Make sure to change your matplotlibrc file (typically located in `~/.config/matplotlib/`; if it's not there, you can create it) to include the line `backend : Qt5Agg`. Otherwise, you may not be able to import `pylab` while importing `brian 1.4.3`. The default backend, `GKAgg`, will not work with this outdated module!\n\nClone this repository to a directory of your choice, denoted by `\u003cstdp-mnist\u003e`. We recommend that your install [Anaconda2](https://www.continuum.io/downloads) and make it your default Python, via adding the line `export PATH=[path to anaconda]/bin:$PATH` to your `.bashrc` (for \\*nix systems), as this will make installing the appropriate packages easier. Change directory into `\u003cstdp-mnist\u003e`, and execute `pip install -r requirements.txt` in a terminal (on \\*nix systems) or a Git Bash shell (on Windows), and then execute `conda install --file conda_requirements.txt`.\n\n## Running the Code\n\nTo train a network, change directory into `\u003cstdp-mnist\u003e/code/train`, and choose one of the scripts therein to train a spiking neural network model on the MNIST handwritten digit dataset. We recommend you train a convolutional spiking neural network with between-patch connectivity (CSNN-PC), which is the most general model in that it can be reduced to a convolutional spiking neural network without between-patch connectivity (CSNN) or simply the spiking neural network model (SNN) from the above [paper](http://journal.frontiersin.org/article/10.3389/fncom.2015.00099/full#) in certain special cases. To do so, simply run\n\n```\npython csnn_pc_mnist.py\n```\n\nto train a CSNN-PC model with default parameters. To see a list of optional arguments to specify on the command line, run\n\n```\npython csnn_pc_mnist.py --help\n```\n\nPerhaps the most useful command-line argument is `do_plot`, which, when set as `do_plot=True`, allows you to visualize network training progress, learned convolution filters and between-patch connection weights, current input to the network, and the distribution of \"votes\" (i.e., individual excitatory neuron classifications) over the last minibatch (`update_interval`) of data.\n\nThere are various supporting scripts in other subfolders of the project repository which allow a user to test or visualize parameters of trained models, plot performance curves, and run jobs on the CICS swarm2 high performance computing cluster. As the project is currently under heavy development, much of the code is fragmented, disorganized, and / or broken, but the state of things will hopefully improve as the project develops.\n\n## Team Members\n\n- Dan Saunders (djsaunde@cs.umass.edu)\n\n- Pegah Taheri (pegahtaheri@gmail.com)\n\n- Hananel Hazan (hananel@hazan.org.il)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdjsaunde%2Flm-snn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdjsaunde%2Flm-snn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdjsaunde%2Flm-snn/lists"}