Skip to main content

An extension to PyTorch: SNN layers that function on traces.

Project description

traceTorch Banner

License PyPI

traceTorch is a PyTorch-based library built on the principles of spiking neural networks, replacing the PyTorch default backpropagation through time with lightweight, per-layer input traces, enabling biologically inspired, constant time and memory consumption learning on arbitrarily long or even streaming sequences.

Documentation

It is highly recommended that you read the documentation first. It contains:

  1. Introduction: An introduction to traceTorch, how and why it works, it's founding principles. It's thoroughly recommended that you read through the entire introduction and gain an intuitive understanding before proceeding.
  2. Tutorials: Various tutorials to create your own traceTorch models. The resultant code can be found in tutorials/.
  3. Documentation: The actual documentation to all the modules included in traceTorch. It includes detailed explanations, examples and math to gain a full understanding.

Roadmap

  • Create the poisson click test example
  • Implement the trace alternative to REINFORCE
  • Finish writing the documentation
  • Move tutorial code to separate repository
  • Implement abstract graph based models, not just sequential

Installation

traceTorch is a PyPI library, which can be found here.

You can install it via pip. All the required packages for it to work are also downloaded automatically.

pip install tracetorch

To use, simply do:

import tracetorch

Usage examples

tutorials/ contains all the tutorial files, ready to run and playtest. The tutorials themselves can be found here.

The tutorials make use of libraries that tracetorch doesn't necessarily use. To ensure that you have all the necessary packages for the tutorials installed, please install the packages listed in tutorials/requirements.txt

cd tutorials/
pip install -r requirements.txt

It's recommended to use an environment that does not have tracetorch installed if using the tutorials, tracetorch/ is structured identically to the library, but is of course a running release.

Authors

Acknowledgements

I built traceTorch from the ground up, trying to reverse engineer biological neurons with a sprinkle of intelligent design, but I would also like to recognize the following projects and people who helped shape my thinking:

  • snntorch for introducing me to SNN networks in the first place, and their principles of function. Ironically, its dependency on constructing the full autograd graph is what largely inspired me to make traceTorch.
  • Artem Kirsanov for introducing me to computational neuroscience, presenting interesting concepts in an easy-to-understand manner. My earliest tests, when I naively wanted to implement 1:1 biological neurons, largely revolved around his work.
  • e-prop (eligibility propagation) inspired the whole "trace" concept, the idea of keeping a decaying value. Earlier, before traceTorch, I wanted to use e-prop for online learning instead. Admittedly unsuccessful in my attempts, and a little put off by the relative difficulty, I instead wanted to make something simpler.

Contributing

Contributions are always welcome. Feel free to submit pull requests or report issues, I will occasionally check in on it.

You can also reach out to me via either email or Twitter:

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

tracetorch-0.1.1.tar.gz (17.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tracetorch-0.1.1-py3-none-any.whl (19.3 kB view details)

Uploaded Python 3

File details

Details for the file tracetorch-0.1.1.tar.gz.

File metadata

  • Download URL: tracetorch-0.1.1.tar.gz
  • Upload date:
  • Size: 17.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.6

File hashes

Hashes for tracetorch-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f52f58736f6e04b5bd67299a71308f504b49dfdbbe2d2aa6e7309a115e1a071b
MD5 e10c655bf569c3a111b6a141e28d644e
BLAKE2b-256 ff728e0bfd030932f4457cc6b3a448d1c0477541688e4cb0cf7a65a97cfae0a8

See more details on using hashes here.

File details

Details for the file tracetorch-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: tracetorch-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 19.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.6

File hashes

Hashes for tracetorch-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 147d439e79e83d0c3f5a9afb85188220c999543e1c28d2b727ea6be3ad212778
MD5 8066296b3bd0d14b43f70c838e889c48
BLAKE2b-256 c3b4030e7fee37802138c74060636bdd9b9d4e72865718901bf4076b7359ff29

See more details on using hashes here.

Supported by

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