API Reference

API Reference#

braintrace trains recurrent and spiking neural networks online — forward in time, without backpropagation through time (BPTT). You mark the trainable operations of a model with ETP primitives (for example braintrace.matmul() instead of x @ w); a compiler then discovers how each parameter influences the network’s hidden states and wires up the eligibility traces that carry gradient information forward.

This reference is organized around the four layers of the package, with dependencies pointing strictly downward, plus the ready-made neural-network layers built on top.

Layer

What it does

Reference

Operators

User-facing ETP ops that mark weights for online learning, and the machinery to register your own primitives.

ETP Operators & Core Types, Custom ETP Primitives

Compiler

Walks the JAX jaxpr, identifies ETP primitives by type, and connects each parameter to the hidden states it influences.

Compiler, Executor & Diagnostics

Executor

Runs the forward pass and computes the hidden→weight / hidden→hidden Jacobians the algorithms consume.

Compiler, Executor & Diagnostics

Algorithms

Online-learning orchestrators: the exact D-RTRL / ES-D-RTRL family and the SNN algorithms (EProp, OSTL, OTPE, OTTT, OSTTP).

Online-Learning Algorithms

Layers

Drop-in brainstate.nn-style layers pre-wired through ETP primitives.

Neural-Network Layers

The fastest way in is the one-call braintrace.compile() entry point, documented in Online-Learning Algorithms.