脉冲神经网络 神经元模型-IF模型(2)

脉冲神经网络 神经元模型-IF模型(2)

一 原理

具有固定阈值的脉冲发放神经元模型具有更高抽象层次,这类模型依赖于所有突触前神经元输入脉冲的积累,当膜电位到达一个固定的阈值时,神经元发放脉冲。
IF模型仅考虑HH神经元模型中漏电流。漏电IF神经元模型的等效电路如图所示:
在这里插入图片描述
在这里插入图片描述

二 代码

clear
close all

C = 0.2;          % capacitance in nF
R = 100;          % resitance in megaohm
dt = 0.01;        % integration time step in milliseconds
dur = 0.3;        % simulation duration in sec
Vthresh = -60;    % threshold in mV
EL = -70;         % leakage reversal potential in mV
Vreset = -70;     % reset voltage in mV
V0 = -70;         % initial condition in mV

tref = 3;         % refractory period in msec
Ij = 0.15;          % injected current in nA 


dur = dur*1000;      % simulation duration in msec
niter = floor(dur/dt)+1;    % number of iterations
V = EL;                     % initial condition
spikes = zeros(1,niter);    % vector for storing binary spike train
Vm = zeros(1,niter);        % vector for storing Vm
Vm(1) = V0;          % assign initial condition to first element of Vm
t_vector = 0:dt:(length(Vm)-1)*dt;  % vector of time values
tcounter = tref;            % counter for how long we have been refracted, 
                                % it is not refracted when we start
taum = R*C;                 % time constant in msec

    for idx =  2 : niter    % loop for number of iterations
        % check if we are refracted
        if tcounter < tref
            V = Vreset; 
            tcounter = tcounter + dt;   % update refractory counter
        else     % we integrate as before
            dVdt =(1/taum) .* ((EL - V) + R * Ij);
            V = V + dt .* dVdt;
        end 
        % check if spiking
        if V > Vthresh
            spikes(idx) = 1;
            V = Vreset;
            tcounter = 0;   % reset refractory counter
        end
        Vm(idx) = V;
    end

plot(t_vector,Vm);
xlabel('time (ms)');
ylabel('V_m (mV)');

运行结果
在这里插入图片描述

三 参考文献

SNN系列|神经元模型篇(4) LIF
Neuronal Dynamics(book)

  • 5
    点赞
  • 30
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值