PeriodicExponential

PeriodicExponential#

:class:~sinabs.activation.PeriodicExponential surrogate gradient.

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()
<matplotlib.legend.Legend at 0x7fc890f092d0>
../../_images/f3716c7e275a25d5372f18cfe8e902e879a81e3cc57b2df21b0a4997bd97e69a.png