MaxSpike

MaxSpike#

:class:~sinabs.activation.MaxSpike activation function.

import matplotlib.pyplot as plt
import torch

import sinabs.activation as sina

v_mem = torch.linspace(0, 5.5, 500)

spike_threshold = 1.0
activations = sina.MaxSpike(max_num_spikes_per_bin=2).apply(
    v_mem, spike_threshold, sina.MultiGaussian()
)
plt.plot(v_mem, activations)
plt.xlabel("Neuron membrane potential")
plt.ylabel("Spike activation")
plt.ylim(top=5.2)
plt.tight_layout()
../../_images/3312b511d1af626f7ca0b653d0e3d94b1bd23fca17682ff9c2aff9e1199a7a05.png