我正在尝试用C ++实现泄漏的集成和激发神经元,但是当新电流到来时,无法找到更新神经元电压的好方法。
我现在正在使用此代码编写,但我是该领域的新手,并不认为这是一个最佳解决方案。这是更新神经元的正确方法吗?
void LIF_neuron::update(double current, size_t time){
//update current
//formula: (V_current - V_reset)*(1-exp((t_last_fired - t_now)/RC)) + R*I
mCurrentVolt += -1*(mCurrentVolt-mResetVolt)*(1-exp((mLastTimeFired-time)/mRC)) + mR*current;
//all leakage since last activation was substracted, give back what was already substracted in earlier updates
mCurrentVolt += (mCurrentVolt-mResetVolt)*(1-exp((mLastTimeFired-mLastTimeUpdated)/mRC));
if(mCurrentVolt >= mThreshold){
mFires = true;
mLastTimeFired = time;
}else{
mFires = false;
}
mLastTimeUpdated = time;
}
mRC
和mR
是神经元的常数。