Spiking NetworksReti a impulsi

A spiking neuron keeps a membrane potential that leaks at every step, adds the current it receives and, when it crosses a threshold, emits a spike and drops by the threshold, so that its output is a train of zeros and ones. Since the spike is a step of the potential, its derivative is zero almost everywhere, and backpropagation through time applied as it is would move no weight. If, in the backward pass only, the derivative of the step is replaced with that of a smooth function (the surrogate gradient), a small network of such neurons can be trained, and the page trains one with Adam to classify points of the plane coded as trains of spikes; one can then see how few spikes its hidden layer needs to answer.

Un neurone a impulsi tiene un potenziale di membrana che a ogni passo si scarica in parte, somma la corrente che riceve e, quando supera una soglia, emette un impulso e scende della soglia, così che la sua uscita è un treno di zeri e di uni. Poiché l'impulso è un gradino del potenziale, la sua derivata è nulla quasi ovunque, e la backpropagation nel tempo applicata così com'è non sposterebbe alcun peso. Se, nel solo passo all'indietro, la derivata del gradino si sostituisce con quella di una funzione liscia (il gradiente surrogato), una piccola rete di questi neuroni si può addestrare, e la pagina ne addestra una con Adam a classificare punti del piano codificati come treni di impulsi; puoi poi vedere con quanti pochi impulsi lo strato nascosto riesce a rispondere.

A single leaky integrate-and-fire neuron, simulated in real time: on top the input current \(I_t = I + \sigma\,\varepsilon_t\) (\(\varepsilon_t\) a standard gaussian), in the middle the membrane potential \(v_t\) with the threshold \(\theta\) dashed, at the bottom the spikes \(s_t\). Between two spikes \(v_t\) climbs towards \(I/(1-\beta)\), and it fires only if that value lies above \(\theta\) or the noise carries it there.Un singolo neurone leaky integrate-and-fire, simulato in tempo reale: in alto la corrente d'ingresso \(I_t = I + \sigma\,\varepsilon_t\) (\(\varepsilon_t\) una gaussiana standard), al centro il potenziale di membrana \(v_t\) con la soglia \(\theta\) tratteggiata, in basso gli impulsi \(s_t\). Fra due impulsi \(v_t\) sale verso \(I/(1-\beta)\), e il neurone emette un impulso solo se quel valore sta sopra \(\theta\) o se il rumore lo porta lì.
The f-I curve: the rate, in spikes per step, under a constant input \(I\) (with the noise \(\sigma\) of the neuron on the left), against the ReLU \(\max(0, I - (1-\beta)\theta)/\theta\), which starts at the same current, the smallest that can lift \(v_t\) to \(\theta\), and has the same slope for large \(I\), since each spike takes away \(\theta\) of charge; the rate stops at 1, one spike per step. Hence, a trained ReLU network can be converted (approximately) into a spiking one by reading its activations as rates.La curva f-I: il tasso, in impulsi per passo, sotto un ingresso costante \(I\) (con il rumore \(\sigma\) del neurone a sinistra), confrontato con la ReLU \(\max(0, I - (1-\beta)\theta)/\theta\), che parte dalla stessa corrente, la più piccola che possa portare \(v_t\) a \(\theta\), e ha la stessa pendenza per \(I\) grande, poiché ogni impulso toglie \(\theta\) di carica; il tasso si ferma a 1, un impulso per passo. Per questo una rete ReLU addestrata si può convertire (in modo approssimato) in una rete a impulsi leggendo le sue attivazioni come tassi.
The spike as a function of \(u = v - \theta\): the step \(H(u)\), whose derivative is zero except at \(u = 0\), the fast sigmoid \(\tilde H(u)\) and its derivative \(\tilde H'(u)\), which the backward pass uses in place of that of \(H\); under them, the histogram of \(v_t - \theta\) of the hidden neurons on the test points. Only the potentials that fall where \(\tilde H'\) is not small carry a gradient; hence, with a steep surrogate few neurons receive one, while with a flat surrogate also neurons far from the threshold do. The steepness \(k\) is the one used in training.L'impulso come funzione di \(u = v - \theta\): il gradino \(H(u)\), la cui derivata è nulla tranne in \(u = 0\), la sigmoide veloce \(\tilde H(u)\) e la sua derivata \(\tilde H'(u)\), che il passo all'indietro usa al posto di quella di \(H\); sotto, l'istogramma di \(v_t - \theta\) dei neuroni nascosti sui punti di test. Solo i potenziali che cadono dove \(\tilde H'\) non è piccola portano un gradiente; con un surrogato ripido lo ricevono quindi pochi neuroni, mentre con uno piatto lo ricevono anche neuroni lontani dalla soglia. La ripidità \(k\) è quella usata nell'addestramento.
The plane, colored by the probability of the violet class for a point coded as the network sees it (with Poisson coding one draw per pixel, hence the grain), with the training points; each coordinate drives two input neurons, one more active as it grows and one as it falls. Click to choose the point whose spikes are shown on the right.Il piano, colorato dalla probabilità della classe viola per un punto codificato come lo vede la rete (con la codifica di Poisson un'estrazione per pixel, da cui la grana), con i punti di addestramento; ogni coordinata pilota due neuroni d'ingresso, uno più attivo quando cresce e uno quando cala. Clicca per scegliere il punto i cui impulsi sono mostrati a destra.
The raster of the chosen point, step by step (columns): the four input neurons in gold, the hidden ones in violet (ordered by their weight to the violet output, the silent ones dimmed), then the two outputs, as spikes or as membrane potentials.Il raster del punto scelto, passo per passo (colonne): i quattro neuroni d'ingresso in oro, quelli nascosti in viola (ordinati per il loro peso verso l'uscita viola, quelli silenti attenuati), poi le due uscite, come impulsi o come potenziali di membrana.

The cross-entropy and the accuracy on 200 test points, each with a coding fixed once (the training points are coded anew at every epoch).L'entropia incrociata e l'accuratezza su 200 punti di test, ciascuno con una codifica fissata una volta per tutte (i punti di addestramento sono codificati di nuovo a ogni epoca).
The mean firing rate \(\bar r\) of the hidden layer on the test points, and the share of hidden neurons that never fire on them; the penalty \(\lambda\) pushes the first down, at some cost in loss, and with it the energy that a neuromorphic chip would spend, which grows with the number of spikes.Il tasso medio \(\bar r\) dello strato nascosto sui punti di test, e la quota di neuroni nascosti che su di essi non emettono mai impulsi; la penalità \(\lambda\) spinge in basso il primo, a un certo costo nella loss, e con esso l'energia che spenderebbe un chip neuromorfico, che cresce con il numero di impulsi.