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 0x7fb4e9daaf90>
../../_images/9d19bbc2fe2d41ce853ce2dc6a66eb5c8d68c2f05a0575d4740d430ef06d2f84.png