SingleExponential#

SingleExponential surrogate gradient.

plot singleexponential
<matplotlib.legend.Legend object at 0x7f9c4d655ad0>

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

x = torch.linspace(-0.5, 3.5, 500)
plt.plot(
    x, sina.SingleExponential()(v_mem=x, spike_threshold=1.0), label="SingleExponential"
)
plt.xlabel("Neuron membrane potential")
plt.ylabel("Derivative")
plt.legend()

Total running time of the script: ( 0 minutes 0.141 seconds)

Gallery generated by Sphinx-Gallery