脉冲神经网络 神经元模型-IF模型(2)
一 原理
具有固定阈值的脉冲发放神经元模型具有更高抽象层次,这类模型依赖于所有突触前神经元输入脉冲的积累,当膜电位到达一个固定的阈值时,神经元发放脉冲。
IF模型仅考虑HH神经元模型中漏电流。漏电IF神经元模型的等效电路如图所示:
二 代码
clearclose allC = 0.2;% capacitance in nFR = 100;% resitance in megaohmdt = 0.01; % integration time step in millisecondsdur = 0.3; % simulation duration in secVthresh = -60; % threshold in mVEL = -70; % leakage reversal potential in mVVreset = -70;% reset voltage in mVV0 = -70; % initial condition in mVtref = 3; % refractory period in msecIj = 0.15;% injected current in nA dur = dur*1000;% simulation duration in msecniter = floor(dur/dt)+1; % number of iterationsV = EL; % initial conditionspikes = zeros(1,niter); % vector for storing binary spike trainVm = zeros(1,niter); % vector for storing VmVm(1) = V0;% assign initial condition to first element of Vmt_vector = 0:dt:(length(Vm)-1)*dt; % vector of time valuestcounter = tref; % counter for how long we have been refracted, % it is not refracted when we starttaum = R*C; % time constant in msecfor idx = 2 : niter % loop for number of iterations% check if we are refractedif tcounter < trefV = Vreset; tcounter = tcounter + dt; % update refractory counterelse% we integrate as beforedVdt =(1/taum) .* ((EL - V) + R * Ij);V = V + dt .* dVdt;end % check if spikingif V > Vthreshspikes(idx) = 1;V = Vreset;tcounter = 0; % reset refractory counterendVm(idx) = V;endplot(t_vector,Vm);xlabel('time (ms)');ylabel('V_m (mV)');
运行结果
三 参考文献
SNN系列|神经元模型篇(4) LIF
Neuronal Dynamics(book)