brainpy.math.surrogate: Surrogate Gradient Functions

brainpy.math.surrogate: Surrogate Gradient Functions#

Surrogate()

The base surrograte gradient function.

Sigmoid([alpha])

Spike function with the sigmoid-shaped surrogate gradient.

sigmoid(x[, alpha])

Spike function with the sigmoid-shaped surrogate gradient.

PiecewiseQuadratic([alpha])

Judge spiking state with a piecewise quadratic function.

piecewise_quadratic(x[, alpha])

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

PiecewiseExp([alpha])

Judge spiking state with a piecewise exponential function.

piecewise_exp(x[, alpha])

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

SoftSign([alpha])

Judge spiking state with a soft sign function.

soft_sign(x[, alpha])

Judge spiking state with a soft sign function.

Arctan([alpha])

Judge spiking state with an arctan function.

arctan(x[, alpha])

Judge spiking state with an arctan function.

NonzeroSignLog([alpha])

Judge spiking state with a nonzero sign log function.

nonzero_sign_log(x[, alpha])

Judge spiking state with a nonzero sign log function.

ERF([alpha])

Judge spiking state with an erf function.

erf(x[, alpha])

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

PiecewiseLeakyRelu([c, w])

Judge spiking state with a piecewise leaky relu function.

piecewise_leaky_relu(x[, c, w])

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

SquarewaveFourierSeries([n, t_period])

Judge spiking state with a squarewave fourier series.

squarewave_fourier_series(x[, n, t_period])

Judge spiking state with a squarewave fourier series.

S2NN([alpha, beta, epsilon])

Judge spiking state with the S2NN surrogate spiking function.

s2nn(x[, alpha, beta, epsilon])

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

QPseudoSpike([alpha])

Judge spiking state with the q-PseudoSpike surrogate function.

q_pseudo_spike(x[, alpha])

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

LeakyRelu([alpha, beta])

Judge spiking state with the Leaky ReLU function.

leaky_relu(x[, alpha, beta])

Judge spiking state with the Leaky ReLU function.

LogTailedRelu([alpha])

Judge spiking state with the Log-tailed ReLU function.

log_tailed_relu(x[, alpha])

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

ReluGrad([alpha, width])

Judge spiking state with the ReLU gradient function.

relu_grad(x[, alpha, width])

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

GaussianGrad([sigma, alpha])

Judge spiking state with the Gaussian gradient function.

gaussian_grad(x[, sigma, alpha])

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

InvSquareGrad([alpha])

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

inv_square_grad(x[, alpha])

Spike function with the inverse-square surrogate gradient.

MultiGaussianGrad([h, s, sigma, scale])

Judge spiking state with the multi-Gaussian gradient function.

multi_gaussian_grad(x[, h, s, sigma, scale])

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

SlayerGrad([alpha])

Judge spiking state with the slayer surrogate gradient function.

slayer_grad(x[, alpha])

Spike function with the slayer surrogate gradient function.

inv_square_grad2

relu_grad2