PeriodicExponential#

PeriodicExponential surrogate gradient.

plot periodicexponential
<matplotlib.legend.Legend object at 0x7f1a076fb610>

import torch
import sinabs.activation as sina
import matplotlib.pyplot as plt

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.135 seconds)

Gallery generated by Sphinx-Gallery