MultiGaussian

MultiGaussian#

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

import matplotlib.pyplot as plt
import torch

import sinabs.activation as sina

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