SingleExponential

SingleExponential#

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

import matplotlib.pyplot as plt
import torch

import sinabs.activation as sina

x = torch.linspace(-2, 4, 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()
plt.show()
../../_images/5bbd28ff2070fd2261bb404088586483549d3451fe82664af1250759c2cba83d.png