SDK

Python in
.thx out

PyTorch-native SNNs. Deterministic simulator. Compiler. pip install thrindex

pip install thrindex

Author

import thrindex.snn as snn
Same muscle memory as torch.nm

  • Canonical LIF parameters

  • No hidden global RNG

CLI transcript
model = snn.Sequential(
snn.Dense(784, 1000),
snn.LIF(threshold=1.0, tau_mem=5.0, reset="subtract"),
snn.Dense(1000, 10),
snn.LIF(threshold=1.0, tau_mem=5.0, reset="subtract"),
)
spikes = rate(x_batch, T=25, generator=gen)
loss = rate_loss(model(spikes), labels)
loss.backward()

Spike encoders

Convert input tensors into spike trains with rate, latency, or delta coding in one call.

Surrogate gradients

Turn tensors into spikes with rate, latency or delta coding.

Rate loss

Cross-entropy on mean firing rates with a standard PyTorch optimizer.

Compile

thx.compile(model, "model.thx")
Graph IR in, sealed artifact out.

CLI transcript
thx.compile(model, "model.thx")
  • Alpha resolved in Rust

  • CRC32 integrity seal

Run

thrindex run model.thx
Behavioral simulator, no hardware.

CLI transcript
thrindex run model.thx
  • Byte-identical spike rasters

  • Zero RNG in simulator