brainpy.math.surrogate.PiecewiseLeakyRelu#

class brainpy.math.surrogate.PiecewiseLeakyRelu(c=0.01, w=1.0, forward_use_surrogate=False)[source]#

Judge spiking state with a piecewise leaky relu function.

__init__(c=0.01, w=1.0, forward_use_surrogate=False)[source]#

Methods

__init__([c, w, 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.