braincore.surrogate module

braincore.surrogate module#

Surrogate Gradient Functions#

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.

Surrogate Gradient Classes#

Sigmoid

Spike function with the sigmoid-shaped surrogate gradient.

PiecewiseQuadratic

Judge spiking state with a piecewise quadratic function.

PiecewiseExp

Judge spiking state with a piecewise exponential function.

SoftSign

Judge spiking state with a soft sign function.

Arctan

Judge spiking state with an arctan function.

NonzeroSignLog

Judge spiking state with a nonzero sign log function.

ERF

Judge spiking state with an erf function.

PiecewiseLeakyRelu

Judge spiking state with a piecewise leaky relu function.

SquarewaveFourierSeries

Judge spiking state with a squarewave fourier series.

S2NN

Judge spiking state with the S2NN surrogate spiking function.

QPseudoSpike

Judge spiking state with the q-PseudoSpike surrogate function.

LeakyRelu

Judge spiking state with the Leaky ReLU function.

LogTailedRelu

Judge spiking state with the Log-tailed ReLU function.

ReluGrad

Judge spiking state with the ReLU gradient function.

GaussianGrad

Judge spiking state with the Gaussian gradient function.

InvSquareGrad

Judge spiking state with the inverse-square surrogate gradient function.

MultiGaussianGrad

Judge spiking state with the multi-Gaussian gradient function.

SlayerGrad

Judge spiking state with the slayer surrogate gradient function.