brainpy.math.operators.step_pwl#

brainpy.math.operators.step_pwl(x, threshold, window=0.5, max_spikes_per_dt=inf) = <jax._src.custom_derivatives.custom_jvp object>[source]#

Heaviside step function with piece-wise linear derivative to use as spike-generation surrogate

Parameters
  • x (float) – Input value

  • threshold (float) – Firing threshold

  • window (float) – Learning window around threshold. Default: 0.5

  • max_spikes_per_dt (int) – Maximum number of spikes that may be produced each dt. Default: np.inf, do not clamp spikes

Returns

Number of output events for each input value

Return type

float