brainpy.math.surrogate module#

sigmoid

Spike function with the sigmoid-shaped surrogate gradient.

piecewise_quadratic

Judge spiking state with a piecewise quadratic function [1]_ [2]_ [3]_ [4]_ [5]_.

piecewise_exp

Judge spiking state with a piecewise exponential function [1]_.

soft_sign

Judge spiking state with a soft sign function.

arctan

Judge spiking state with an arctan function.

nonzero_sign_log

Judge spiking state with a nonzero sign log function.

erf

Judge spiking state with an erf function [1]_ [2]_ [3]_.

piecewise_leaky_relu

Judge spiking state with a piecewise leaky relu function [1]_ [2]_ [3]_ [4]_ [5]_ [6]_ [7]_ [8]_.

squarewave_fourier_series

Judge spiking state with a squarewave fourier series.

s2nn

Judge spiking state with the S2NN surrogate spiking function [1]_.

q_pseudo_spike

Judge spiking state with the q-PseudoSpike surrogate function [1]_.

leaky_relu

Judge spiking state with the Leaky ReLU function.

log_tailed_relu

Judge spiking state with the Log-tailed ReLU function [1]_.

relu_grad

Spike function with the ReLU gradient function [1]_.

gaussian_grad

Spike function with the Gaussian gradient function [1]_.

inv_square_grad

Spike function with the inverse-square surrogate gradient.

multi_gaussian_grad

Spike function with the multi-Gaussian gradient function [1]_.

slayer_grad

Spike function with the slayer surrogate gradient function.

inv_square_grad2

relu_grad2