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 0x7e2ccb4b9dd0>
../../_images/f45602b84acbef917386765bd79187c49552adb0e2ea45efd0988ecc89e012e1.png