Sparse & Event-based Operators#

pre-syn-post Transformations#

pre2post_sum(pre_values, post_num, post_ids)

The pre-to-post synaptic summation.

pre2post_prod(pre_values, post_num, post_ids)

The pre-to-post synaptic production.

pre2post_max(pre_values, post_num, post_ids)

The pre-to-post synaptic maximization.

pre2post_min(pre_values, post_num, post_ids)

The pre-to-post synaptic minimization.

pre2post_mean(pre_values, post_num, post_ids)

The pre-to-post synaptic mean computation.

pre2post_event_sum(events, pre2post, post_num)

The pre-to-post event-driven synaptic summation with CSR synapse structure.

pre2post_coo_event_sum(events, pre_ids, ...)

The pre-to-post synaptic computation with event-driven summation.

pre2post_event_prod(events, pre2post, post_num)

The pre-to-post synaptic computation with event-driven production.

pre2syn(pre_values, pre_ids)

The pre-to-syn computation.

syn2post_sum(syn_values, post_ids, post_num)

The syn-to-post summation computation.

syn2post(syn_values, post_ids, post_num[, ...])

The syn-to-post summation computation.

syn2post_prod(syn_values, post_ids, post_num)

The syn-to-post product computation.

syn2post_max(syn_values, post_ids, post_num)

The syn-to-post maximum computation.

syn2post_min(syn_values, post_ids, post_num)

The syn-to-post minimization computation.

syn2post_mean(syn_values, post_ids, post_num)

The syn-to-post mean computation.

syn2post_softmax(syn_values, post_ids, post_num)

The syn-to-post softmax computation.

Sparse Matrix Multiplication#

sparse_matmul(A, B)

Sparse matrix multiplication.

csr_matvec(values, indices, indptr, vector, ...)

Product of CSR sparse matrix and a dense vector.

Event-based Matrix Multiplication#

event_csr_matvec(values, indices, indptr, ...)

The pre-to-post event-driven synaptic summation with CSR synapse structure.

Surrogate Gradients for Spike Operation#

spike_with_sigmoid_grad

spike_with_linear_grad

spike_with_gaussian_grad

spike_with_mg_grad

spike2_with_sigmoid_grad

spike2_with_linear_grad

step_pwl(x, threshold[, window, ...])

Heaviside step function with piece-wise linear derivative to use as spike-generation surrogate

Operator Registration#

register_op(name, eval_shape, cpu_func[, ...])

Converting the numba-jitted function in a Jax/XLA compatible primitive.

XLACustomOp([eval_shape, con_compute, ...])

Creating a XLA custom call operator.

Other Operators#

segment_sum(data, segment_ids[, ...])

segment_sum operator for brainpy JaxArray and Variable.

segment_prod(data, segment_ids[, ...])

segment_prod operator for brainpy JaxArray and Variable.

segment_max(data, segment_ids[, ...])

segment_max operator for brainpy JaxArray and Variable.

segment_min(data, segment_ids[, ...])

segment_min operator for brainpy JaxArray and Variable.