braintools module

braintools module#

BrainTools aggregates reusable building blocks for spiking neural computations, including encoders, spike arithmetic utilities, and parameter transforms.

Spike Encoders#

Encoders that convert continuous-valued signals or event streams into spike trains suitable for spiking network simulations.

LatencyEncoder

Encode the rate input as the spike train using the latency encoding.

RateEncoder

Encode analog values into spike rates using various rate encoding methods.

PoissonEncoder

Encode inputs as Poisson spike trains.

PopulationEncoder

Encode scalar values using population coding.

BernoulliEncoder

Encode inputs using independent Bernoulli processes.

DeltaEncoder

Encode temporal differences (delta changes) in input signals.

StepCurrentEncoder

Encode inputs as step current injections for LIF neurons.

SpikeCountEncoder

Encode inputs as exact spike counts over time windows.

TemporalEncoder

Encode temporal patterns using synchronized spike timing.

RankOrderEncoder

Encode inputs using rank order coding.

Spike Operations#

Vectorized boolean and arithmetic helpers for manipulating spike trains and combining encoder outputs.

spike_bitwise_or

Perform a bitwise OR operation on spike tensors.

spike_bitwise_and

Perform a bitwise AND operation on spike tensors.

spike_bitwise_iand

Perform a bitwise IAND (Inverse AND) operation on spike tensors.

spike_bitwise_not

Perform a bitwise NOT operation on spike tensors.

spike_bitwise_xor

Perform a bitwise XOR operation on spike tensors.

spike_bitwise_ixor

Perform a bitwise IXOR (Inverse XOR) operation on spike tensors.

spike_bitwise

Perform bitwise operations on spike tensors.