brainpy.math.surrogate.SquarewaveFourierSeries#

class brainpy.math.surrogate.SquarewaveFourierSeries(n=2, t_period=8.0, forward_use_surrogate=False)[source]#

Judge spiking state with a squarewave fourier series.

__init__(n=2, t_period=8.0, forward_use_surrogate=False)[source]#

Methods

__init__([n, t_period, forward_use_surrogate])

call(x)

Call the function for surrogate gradient propagation.

surrogate_fun(x)

The surrogate function.

surrogate_grad(dz, x)

The gradient for the surrogate function.

true_fun(x)

The original true function.