Gaussian

Gaussian#

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

import matplotlib.pyplot as plt
import torch

import sinabs.activation as sina

x = torch.linspace(-2, 4, 500)
plt.plot(x, sina.Gaussian()(v_mem=x, spike_threshold=1.0), label="Gaussian")
plt.xlabel("Neuron membrane potential")
plt.ylabel("Derivative")
plt.legend()
plt.show()
../../_images/e69a3ff2e3ce963a0fc75dccacce9dbcfc0a0491a90e4a9ab0e846756597614a.png