In this case a layer of interconnected leaky neurons is characterised by a positive tanh as a transfer function. The time component is slower than the one we have in spiking neurons (the decay of the leaky is at least 100 times slower), as a consequence each of these slow units can be conceived as simulating the average activity of a whole neural population or cluster of spiking neurons.
These type of units have been used, for instance, here: http://journal.frontiersin.org/article/10.3389/fpsyg.2014.00124/full
NB the simulation require the use of a step function, see below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
clear all close all T=100; %equivalent of 5 seconds (T=secs*1000/dt) dim1=3; %number of units per layer A.potential = zeros(T,dim1); A.activity = zeros(T,dim1); input= zeros(T,dim1); %matrix of all possible lateral connections in the layer mat=[0 0 2 %connection from unit 1 to 3 2 0 0 %connection from unit 2 to 1 0 -2 0]; %connection from unit 3 to 2 dt=50; decay=[300 600 1200]; baseline =[0.0 0.5 0.0]; threshold=[0.0 0.2 0.1]; noise=0; %if noise=1 -> bl=bl+-0.1 for t=2:T A=leaky_step(t, dt, A, input(t-1,:), decay, baseline, mat, threshold, noise); if t<100 input(t,:)=[0 1 0]; else input(t,:)=[0 0 0]; end end figure subplot(2,1,1) plot (A.activity) legend('1', '2', '3') subplot(2,1,2) imagesc (A.activity') |
Step function to update the activity of the units in the cluster. Save this code as a separate file with the name “leaky_step” in the same folder as the main file above.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
function output = leaky_step(t, dt, structure, input, decay, baseline, self_w,th_out, noise_switch) baseline=baseline + ((rand(1, length(structure.activity(t,:)))*2-1)/10) .*noise_switch; %action potential structure.potential(t,:) = structure.potential(t-1,:) + (dt./decay).*(-structure.potential(t-1,:) + ... baseline + input + (structure.activity(t-1,:)*self_w)); %transfer function structure.activity(t,:) = max (0, tanh(structure.potential(t,:).*(structure.potential(t,:)>th_out))); output = structure; |