Skip to content

Commit 41c3f76

Browse files
Update README.md
1 parent 4d75cf1 commit 41c3f76

1 file changed

Lines changed: 44 additions & 55 deletions

File tree

README.md

Lines changed: 44 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,102 +1,91 @@
11
<div align="center">
22

3-
# Neuromorphic Decision Transformer (SNN-DT)
3+
# 🧠 Neuromorphic Decision Transformer (SNN-DT)
44

55
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
66
[![Python](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)
77
[![PyTorch](https://img.shields.io/badge/PyTorch-1.12+-ee4c2c.svg)](https://pytorch.org/)
88
[![arXiv](https://img.shields.io/badge/arXiv-2508.21505-b31b1b.svg)](https://arxiv.org/abs/2508.21505)
9-
9+
[![Documentation](https://img.shields.io/badge/docs-Vercel%20Deployed-black?style=flat-square&logo=vercel)](https://vishal-sys-code.github.io/neuromorphic_decision_transformer/)
1010

1111
**Local Plasticity, Phase-Coding, and Dendritic Routing for Low-Power Sequence Control**
12+
</div>
13+
14+
---
15+
16+
## 🌟 Overview
17+
18+
This repository contains the official PyTorch implementation of the **Spiking Decision Transformer (SNN-DT)**, as presented in our flagship research paper:
19+
> *"Spiking Decision Transformers: Local Plasticity, Phase-Coding, and Dendritic Routing for Low-Power Sequence Control"* (Pandey & Biswas, 2025).
1220
13-
[![Documentation](https://img.shields.io/badge/docs-GitHub%20Pages-blue)](https://vishal-sys-code.github.io/neuromorphic_decision_transformer/)
21+
The SNN-DT architecture bridges the gap between the sequential modeling capabilities of dense Transformers and the extreme energy efficiency of Spiking Neural Networks (SNNs). By embedding **Leaky Integrate-and-Fire (LIF)** neurons within the block components, we secure state-of-the-art performance on continuous control tasks while reducing energy consumption by over four orders of magnitude ($\approx 40$ nJ).
1422

23+
<div align="center">
24+
<img src="model_architecture.png" alt="SNN-DT Architecture" width="850">
1525
</div>
1626

17-
## Abstract
27+
---
1828

19-
This repository contains the official PyTorch implementation of the **Spiking Decision Transformer (SNN-DT)**, as presented in the paper *"Spiking Decision Transformers: Local Plasticity, Phase-Coding, and Dendritic Routing for Low-Power Sequence Control"* (Pandey & Biswas, 2025).
29+
## ✨ Core Neuromorphic Innovations
2030

21-
The SNN-DT architecture bridges the gap between the sequential modeling capabilities of Transformers and the energy efficiency of Spiking Neural Networks (SNNs). By embedding **Leaky Integrate-and-Fire (LIF)** neurons within the self-attention mechanism and utilizing accurate **STDP-inspired local plasticity**, this model achieves state-of-the-art performance on continuous control tasks while reducing energy consumption by orders of magnitude compared to traditional ANN-based Decision Transformers.
31+
- 🕒 **Phase-Coded Positional Encoding:** Replaces generic float embeddings with rhythmic, spike phase-shifted encodings.
32+
- 🌳 **Dendritic-Style Routing MLP:** Context-dependent gating coefficients dynamically prune attention heads without uniform averaging.
33+
- 🧬 **Three-Factor Local Plasticity:** Elegantly implements STDP-like localized credit assignment rules, circumventing catastrophic unrolling.
2234

2335
<div align="center">
24-
<img src="model_architecture.png" alt="SNN-DT Architecture" width="800">
36+
<img src="visualizations/routing_coefficients_heatmap.png" alt="Routing Heatmap" width="600">
37+
<p><em>Dynamic Dendritic Gating Coefficients</em></p>
2538
</div>
26-
*(Note: Visualizations available in the `visualizations/` directory)*
27-
28-
## Key Features
2939

30-
- **Neuromorphic Efficiency**: Replaces standard activation functions with temporal spike-based logic, significantly reducing computational overhead suitable for edge deployment.
31-
- **Phase-Coded Positional Encoding**: A biologically plausible method for encoding sequence order using spike timing phases.
32-
- **Dendritic Routing**: Efficient information routing mechanism mimicking biological dendritic trees.
33-
- **Three-Factor Local Plasticity**: Implements STDP-like learning rules for robust weight updates without heavy backpropagation costs during inference-time adaptation.
34-
- **Standard Gym Benchmarks**: Evaluated on classic control tasks: `CartPole-v1`, `Pendulum-v1`, `MountainCar-v0`, and `Acrobot-v1`.
40+
---
3541

36-
## Installation
42+
## 🚀 Quickstart & Installation
3743

38-
System requirements: Linux/Windows, Python 3.8+, CUDA-enabled GPU (recommended).
44+
**System Requirements:** Linux/Windows, Python 3.8+, CUDA-enabled GPU (Recommended).
3945

4046
```bash
4147
# Clone the repository
4248
git clone https://github.com/Vishal-sys-code/neuromorphic_decision_transformer.git
4349
cd neuromorphic_decision_transformer
4450

45-
# Create a virtual environment (optional but recommended)
46-
python -m venv venv
47-
source venv/bin/activate # On Windows: venv\Scripts\activate
48-
49-
# Install dependencies
51+
# Install core dependencies natively
5052
pip install -r requirements.txt
5153
```
5254

53-
## Usage
55+
> [!TIP]
56+
> For deploying the documentation locally via Sphinx, execute `make html` inside the `/docs` directory!
57+
58+
---
59+
60+
## 💻 Experimental Workflows
5461

55-
### Training
56-
To train the SNN-DT model on a specific environment (e.g., `Pendulum-v1`), use the provided training script. The training pipeline handles data generation, preprocessing, and model optimization.
62+
### 1. Training the Architecture
63+
Run the SNN-DT training pipeline, handling automated data orchestration and surrogate gradient optimization.
5764

5865
```bash
59-
# Run training for Pendulum-v1
6066
python snn-dt/scripts/train.py --model snn_dt --env "Pendulum-v1" --save-dir "results/snn_dt_pendulum"
6167
```
62-
63-
To run the full suite of experiments across all environments:
68+
Or execute the entire benchmarking suite across **CartPole-v1**, **MountainCar-v0**, and **Acrobot-v1**:
6469
```bash
6570
./run_all_experiments.sh
6671
```
6772

68-
### Evaluation
69-
Evaluate a pre-trained checkpoint to measure return, spike counts, latency, and estimated energy consumption.
70-
73+
### 2. Neuromorphic Evaluation & Profiling
74+
Evaluate checkpoint inference trajectories and monitor strict event-driven metrics (absolute spike outputs).
7175
```bash
7276
python eval_snn_dt.py \
7377
--env "Pendulum-v1" \
7478
--checkpoint_path "results/snn_dt_pendulum/best_model.pt" \
75-
--target_return -200 \
76-
--episodes 50
79+
--target_return -200
7780
```
81+
> [!NOTE]
82+
> The runtime reports normalized return against the expert policy baseline alongside the average hardware energy proxies (Spikes / timestep).
7883
79-
**Key Arguments:**
80-
- `--context_len`: Context length ($K$) for the transformer (default: 20).
81-
- `--per_spike_energy`: Estimated energy per spike in Joules (default: 4.6pJ for 45nm process).
82-
83-
## Project Structure
84+
---
8485

85-
```
86-
neuromorphic_decision_transformer/
87-
├── configs/ # YAML configuration files for experiments
88-
├── snn-dt/ # Core SNN-DT source code
89-
│ ├── src/ # Model definitions and extensive util libraries
90-
│ └── scripts/ # Training and utility scripts
91-
├── demos/ # Demonstration notebooks and videos
92-
├── eval_snn_dt.py # Standalone evaluation script
93-
├── requirements.txt # Python dependencies
94-
└── run_all_experiments.sh # Batch experiment runner
95-
```
86+
## 📖 Citation
9687

97-
## Citation
98-
99-
If you use this code or find our work helpful, please cite our paper:
88+
If you build upon this architecture or framework, please consider citing our underlying research:
10089

10190
```bibtex
10291
@article{pandey2025spiking,
@@ -107,6 +96,6 @@ If you use this code or find our work helpful, please cite our paper:
10796
}
10897
```
10998

110-
## License
111-
112-
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
99+
<div align="center">
100+
<i>Maintained with ❤️ by the SNN-DT Research Team. Licensed under <a href="LICENSE">MIT</a>.</i>
101+
</div>

0 commit comments

Comments
 (0)