Note
Go to the end to download the full example code
PeriodicExponential#
PeriodicExponential
surrogate gradient.

<matplotlib.legend.Legend object at 0x7fded0b8c590>
import matplotlib.pyplot as plt
import torch
import sinabs.activation as sina
x = torch.linspace(-2, 4, 500)
plt.plot(
x,
sina.PeriodicExponential()(v_mem=x, spike_threshold=1.0),
label="PeriodicExponential",
)
plt.xlabel("Neuron membrane potential")
plt.ylabel("Derivative")
plt.legend()
Total running time of the script: ( 0 minutes 0.131 seconds)