An extension to PyTorch: SNN layers that function on traces.
Project description
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:
- 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.
- Tutorials: Various tutorials to create your own traceTorch models. The resultant code can be found in
tutorials/. - 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
- Make traceTorch into a PyPI library
- Finish writing the documentation
- Clean up the tutorial code
- Implement abstract graph based models, not just sequential
Installation
⚠️ WARNING, traceTorch is not yet a library. For now, you'll just have to clone this repository and use the
tracetorch/ folder within.
git clone https://github.com/Yegor-men/tracetorch
cd tracetorch/
pip install -r requirements.txt
Then, within a python file where from where the repository root folder is visible, simply do:
from tracetorch import tracetorch
Usage examples
tutorials/ contains all the tutorial files, ready to run and playtest. The tutorials themselves can be
found here.
To ensure that you have all the necessary packages for the tutorials installed, please execute the following command:
cd tutorials/
pip install -r requirements.txt
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tracetorch-0.1.0.tar.gz.
File metadata
- Download URL: tracetorch-0.1.0.tar.gz
- Upload date:
- Size: 17.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
71fc5b473b44372746c33f20bd9c103456d053d18c2c4aa853eadc0177a3dab8
|
|
| MD5 |
d7fd30d9a1ec4721434e60d0ecb25950
|
|
| BLAKE2b-256 |
68e1974015eae3b58b090b6110f6f1c1671a5945de979fe789d89489d1fa2fd2
|
File details
Details for the file tracetorch-0.1.0-py3-none-any.whl.
File metadata
- Download URL: tracetorch-0.1.0-py3-none-any.whl
- Upload date:
- Size: 19.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c1eb0570826a957a8d2e93ce11d547e6468746bd476e14cd62aee3398c43f84a
|
|
| MD5 |
742fe9dc64e0ac6a388a7ab176123ebf
|
|
| BLAKE2b-256 |
13696ddddddc03ca90016c14de1fceaac6a3fa53f2000e0e618019bcd96148fc
|