{"id":37073161,"url":"https://github.com/electronicvisions/jaxsnn","last_synced_at":"2026-01-14T08:35:12.304Z","repository":{"id":163880408,"uuid":"636711809","full_name":"electronicvisions/jaxsnn","owner":"electronicvisions","description":"jaxsnn is an event-based approach to machine-learning-inspired training and simulation of SNNs, including support for the BrainScaleS-2 neuromorphic backend.","archived":false,"fork":false,"pushed_at":"2025-11-26T10:15:21.000Z","size":6265,"stargazers_count":27,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-11-28T03:20:03.781Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/electronicvisions.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-05-05T13:20:39.000Z","updated_at":"2025-11-26T10:15:26.000Z","dependencies_parsed_at":"2023-12-07T18:25:48.986Z","dependency_job_id":"6772800e-d7c9-4c2b-b604-44a7c48c608d","html_url":"https://github.com/electronicvisions/jaxsnn","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/electronicvisions/jaxsnn","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/electronicvisions%2Fjaxsnn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/electronicvisions%2Fjaxsnn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/electronicvisions%2Fjaxsnn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/electronicvisions%2Fjaxsnn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/electronicvisions","download_url":"https://codeload.github.com/electronicvisions/jaxsnn/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/electronicvisions%2Fjaxsnn/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28414458,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T08:31:27.429Z","status":"ssl_error","status_checked_at":"2026-01-14T08:31:19.098Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2026-01-14T08:35:11.667Z","updated_at":"2026-01-14T08:35:12.291Z","avatar_url":"https://github.com/electronicvisions.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![/ˈdʒæksən/](doc/logo_256.png)\n\n# jaxsnn\n\n`jaxsnn` (pronounced like Jackson /ˈdʒæksən/) is an event-based approach to\nmachine-learning-inspired training and simulation of SNNs, including support\nfor neuromorphic backends (BrainScaleS-2).\nWe build upon [jax](https://github.com/google/jax), a Python library providing\nautograd and XLA functionality for high-performance machine learning research.\n\n\n## Installation\n\nWe provide a pypi build of the software that lacks support for the\nBrainScaleS-2 neuromorphic hardware system. The usual `pip install jaxsnn`\nstuff should work, but YMMV.\n\n\n## Building the Software\n\nThe software builds upon existing libraries, such as\n[jax](https://github.com/google/jax),\n[optax](https://github.com/deepmind/optax),\nand [tree-math](https://github.com/google/tree-math).\nWhen using the neuromorphic BrainScaleS-2 backend, the software stack of the\nplatform is required.\n\nWe provide a container image (based on the [Apptainer format](https://apptainer.org/)) including all build-time and runtime dependencies.\nFeel free to download the most recent version from [here](https://openproject.bioai.eu/containers/).\n\nFor all following steps, we assume that the most recent Apptainer container is located at `/containers/stable/latest`.\n\n\n### Github-based Build\nTo build this project from public resources, adhere to the following guide:\n\n```shell\n# 1) Most of the following steps will be executed within a apptainer container\n#    To keep the steps clutter-free, we start by defining an alias\nshopt -s expand_aliases\nalias c=\"apptainer exec --app dls /containers/stable/latest\"\n\n# 2) Prepare a fresh workspace and change directory into it\nmkdir workspace \u0026\u0026 cd workspace\n\n# 3) Fetch a current copy of the symwaf2ic build tool\ngit clone https://github.com/electronicvisions/waf -b symwaf2ic symwaf2ic\n\n# 4) Build symwaf2ic\nc make -C symwaf2ic\nln -s symwaf2ic/waf\n\n# 5) Setup your workspace and clone all dependencies (--clone-depth=1 to skip history)\nc ./waf setup --repo-db-url=https://github.com/electronicvisions/projects --project=jaxsnn\n\n# 6) Load PPU cross-compiler toolchain (or build https://github.com/electronicvisions/oppulance)\nmodule load ppu-toolchain\n\n# 7) Build the project\n#    Adjust -j1 to your own needs, beware that high parallelism will increase memory consumption!\nc ./waf configure\nc ./waf build -j1\n\n# 8) Install the project to ./bin and ./lib\nc ./waf install\n\n# 9) If you run programs outside waf, you'll need to add ./lib and ./bin to your path specifications\nexport APPTAINERENV_PREPEND_PATH=`pwd`/bin:$APPTAINERENV_PREPEND_PATH\nexport APPTAINERENV_LD_LIBRARY_PATH=`pwd`/lib:$APPTAINERENV_LD_LIBRARY_PATH\nexport PYTHONPATH=`pwd`/lib:$PYTHONPATH\nexport PYTHONPATH=`pwd`/lib/python3.10/site-packages:$PYTHONPATH\n\n# 10) To validate that your build was successful, execute the following example\npython -m jaxsnn.examples.event.yinyang_analytical\n```\n\n## Structure\n\n`jaxsnn` is split into two parts. Training of **SNNs** is done in the init/apply style.\n\n\n### Time Discrete\n\n`jaxsnn.discrete` simulates **SNNs** by treating time in a discrete way. It uses euler steps of a fixed size to advance the network forward in time which draws inspiration from [norse](www.github.com/norse/norse).\n\n\n### Time Continuous\n\n`jaxsnn.event` treats time continously and allows jumping from one event to the next one. It's core functionality consists of the `step` function, which does three things:\n\n1. Find the next threshold crossing\n2. Integrate the neuron to this point in time\n3. Apply the discontinuity after the threshold crossing\n\n`jaxsnn.event.modules.leaky_integrate_and_fire` provides multiple neuron types which can be used to build larger networks. Each neuron type defines the three functions mentioned above.\n\n\n### BSS-2 Connection\n\n`jaxsnn.event.hardware` provides functionality to connect to the [BSS-2 system](https://www.frontiersin.org/articles/10.3389/fnins.2022.795876/full) and to conduct learning experiments on dedicated neuromorphic hardware.\n\n\n## First Steps\n\nWe provide multiple examples for usage of `jaxsnn`.\n\nTime discrete learning using surrogate gradients on the Yin-Yang dataset:\n\n```bash\npython -m jaxsnn.examples.discrete.yinyang\n```\n\nEvent-based two layer feed-forward network with analytical gradients:\n\n```bash\npython -m jaxsnn.examples.event.yinyang_analytical\n```\n\nEvent-based two-layer feed-forward network with gradients computed using the EventProp algorithm:\n\n```bash\npython -m jaxsnn.examples.event.yinyang_layered_event_prop\n```\n\nEvent-based recurrent network with gradients computed using the EventProp algorithm:\n\n```bash\npython -m jaxsnn.examples.event.yinyang_recurrent_event_prop\n```\n\n### BSS-2\n\nIf you want to work with the BSS-2 system, a working example is provided:\n\n```bash\npython -m jaxsnn.examples.event.yinyang_bss2\n```\n\nThe operation point calibration script is `src/pyjaxsnn/jaxsnn/event/hardware/calib/neuron_calib.py`.\nExample:\n\n```bash\nsrun -p cube --wafer 69 --fpga-without-aout 0 --pty c python ./neuron_calib.py \\\n\t--wafer           W69F0 \\\n\t--threshold         150 \\\n\t--tau-syn          6e-6 \\\n\t--tau-mem         12e-6 \\\n\t--refractory-time 30e-6 \\\n\t--synapse-dac-bias 1000\n\t--calib-dir src/pyjaxsnn/jaxsnn/event/hardware/calib\n```\n\nIf you want to study the behaviour that different hardware artifacts (noise on the spike times) have on the performance of SNNs, check out this example:\n\n```bash\npython -m jaxsnn.examples.event.hardware.yinyang_mock\n```\n\nYou can switch between an actual execution on BSS-2 and a pure software mock mode, in which the hardware is emulated by a second software network. You can\nadd noise to spikes from this first network or limit the dynamic range (like it is on BSS-2).\n\n\n## TODO\n\n- The mapping between the hardware neuron modules `HardwareRecurrentLIF` (which can simulate multiple feed-forward layers) and the populations / projections is not yet implemented cleanly and is hacked into the tasks (experiment returns a list of spikes for two layers, which are merged together, projections are hardcoded)\n\n\n## Acknowledgements\n\nThe software in this repository has been developed by staff and students\nof Heidelberg University as part of the research carried out by the\nElectronic Vision(s) group at the Kirchhoff-Institute for Physics.\n\nThis work has received funding from the EC Horizon 2020 Framework Programme\nunder grant agreements 785907 (HBP SGA2) and 945539 (HBP SGA3), the Deutsche\nForschungsgemeinschaft (DFG, German Research Foundation) under Germany's\nExcellence Strategy EXC 2181/1-390900948 (the Heidelberg STRUCTURES Excellence\nCluster), the German Federal Ministry of Education and Research under grant\nnumber 16ES1127 as part of the Pilotinnovationswettbewerb Energieeffizientes\nKI-System, the Helmholtz Association Initiative and Networking Fund [Advanced\nComputing Architectures (ACA)] under Project SO-092, as well as from the\nManfred Stärk Foundation, and the Lautenschläger-Forschungspreis 2018 for\nKarlheinz Meier.\n\n## Licensing\n\n`SPDX-License-Identifier: LGPL-2.1-or-later`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felectronicvisions%2Fjaxsnn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felectronicvisions%2Fjaxsnn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felectronicvisions%2Fjaxsnn/lists"}