[SNNTorch] Tutorial 2 - The Leaky integrate and fire neuron
Neuron model์ ์ข ๋ฅ
!https://github.com/jeshraghian/snntorch/blob/master/docs/_static/img/examples/tutorial2/2_1_neuronmodels.png?raw=true
-
Hodgkin-Huxley ๋ด๋ฐ ๋ชจ๋ธ
์๋ฌผ๋ฌผ๋ฆฌํ์ ์ผ๋ก ๊ตฌํ๋ ๋ชจ๋ธ๋ก ์ ๊ธฐ์๋ฆฌํ์ (electrophysiological) ๊ฒฐ๊ณผ๋ฅผ ๋งค์ฐ ๋์ ์ ํ๋๋ก ์ฌํํ ์ ์์ง๋ง ๋ณต์ก์ฑ์ด ๋์์ ์ฌ์ฉ๋์ง ์๊ณ ์์
-
์ธ๊ณต ๋ด๋ฐ ๋ชจ๋ธ
์ ๋ ฅ ๊ฐ์ ๊ฐ์ค์น์ ๊ณฑํด์ง ๋ค์ ํ์ฑํ ํจ์(Activatoin function)์ ์ ๋ฌ๋๋ค. ์ค๋๋ AI์์ ์ฐ์ด๊ณ ์๋ ๋ถ์ผ๋ค.
-
Leaky Integrate-and-Fire (LIF) ๋ด๋ฐ ๋ชจ๋ธ
์๋ฌผ๋ฌผ๋ฆฌํ ๋ชจ๋ธ๊ณผ ์ธ๊ณต ๋ด๋ฐ ๋ชจ๋ธ ๋ ๋ชจ๋ธ์ด ์์ธ ๋ชจ๋ธ์ด๋ค. LIF ๋ชจ๋ธ์ ์ ๋ ฅ ๊ฐ๊ณผ ๊ฐ์ค์น์ ๊ณฑํ ๊ฐ์ ํฉ์ ๊ณ์ฐํ๋ค. ์ด๋ ์ธ๊ณต ๋ด๋ฐ ๋ชจ๋ธ๊ณผ ๋ฌ๋ฆฌ ์๊ฐ์ ๋ฐ๋ผ ์ ๋ ฅ์ ํฉํ๊ณ ๋์ถ์ํจ๋ค. ์ด๋ ํฉํ ๊ฐ์ด ์๊ณ๊ฐ์ ์ด๊ณผํ๋ฉด ์ ์ ์คํ์ดํฌ๋ฅผ ๋ฐ์ํ๋ค.
์ด๋ ์ ๋ณด๋ Spike์ ์ ์ฅ๋์ง ์๊ณ Spike๊ฐ ๋ฐ์ํ ํ์ด๋ฐ, ๋น๋์ ์ ๋ณด๊ฐ ์ ์ฅ๋๋ค.
SNNTorch LIF model ์ข ๋ฅ
- Lapicqueโs RC model:ย
snntorch.Lapicque
- 1st-order model:ย
snntorch.Leaky
- Synaptic Conductance-based neuron model:ย
snntorch.Synaptic
- Recurrent 1st-order model:ย
snntorch.RLeaky
- Recurrent Synaptic Conductance-based neuron model:ย
snntorch.RSynaptic
- Alpha neuron model:ย
snntorch.Alpha
Leaky Integrate-and-Fire Neuron model
Spiking neuron
์ฐ๋ฆฌ์ ๋๋ ํ๋์ ๋ด๋ฐ์ด ๋ค๋ฅธ ๋ด๋ฐ๊ณผ ์ฐ๊ฒฐ๋์ด ์๋ค. ์ฆ ํ๋์ ๋ด๋ฐ์ด Spike๋ฅผ ๋ฐ์ ์ํค๋ฉด ์ฐ๊ฒฐ๋ ๋ด๋ฐ์ด ํฅ๋ถ or ์ต์ ๋ฑ ์ํฅ์ ๋ฐ๊ฒ ๋๋ค.
์ด๋ ๊ฐ๊ฐ์ ๋ค์๊ณผ ๊ฐ์ ๊ณณ์์ ์จ๋ค.
- ๊ฐ๊ฐ ์ฃผ๋ณ๋ถ (sensory periphery)
- ๋ด๋ฐ์ ์ธ์์ ์ผ๋ก ์๊ทน - ์นจ์ต์ฑ ์ ๊ทน(invasive electrode), ํน์ ๋๋ถ๋ถ ์ํฉ
-
์ ๋ด๋ฐ๋ค๋ก ๋ถํฐ (pre-synaptic neurons)
!https://github.com/jeshraghian/snntorch/blob/master/docs/_static/img/examples/tutorial2/2_2_intuition.png?raw=true
Spike๋ ๋งค์ฐ ์งง์ ์ ๊ธฐ์ ์ ํธ์ด๊ธฐ์ ๋ชจ๋ ์ ๋ ฅ Spike๊ฐ ๋์์ ๋์ฐฉํ์ง ์๋ ๊ฒฝ์ฐ๊ฐ ๋ง๋ค. ๋ฐ๋ผ์ neuron์ ์ด๋ฌํ ์๊ฐ ์ฐจ๋ฅผ ๊ธฐ์ต or ์ ์งํ๋ฉฐ ๋ฐ์ํ๋ค. ์ฆ ๋ด๋ฐ์ ์ ๋ ฅ๋ Spike์ ๋ํด ๋ฐ๋ก ์ฒ๋ฆฌํ์ง ์๊ณ ์ง์ฐ๋๋ฉด์ ๋ฐ์ํ๋ ํน์ฑ์ ๊ฐ์ง๊ณ ์๋ค.
The Passive membrane
neuron์ ์์ ๋ง์ผ๋ก ๋๋ฌ์ธ์ฌ ์๋ค. ์ด๋ ์ด ๋ง์ ์ ์ฐ์ฒด๋ก ์ ๋์ฑ ์ฉ์ก์ ๋ ๊ฐ๋ก ๋ถ๋ฆฌํด์ ์ปคํจ์ํฐ ์ญํ ์ ํ๋ค.
๋ํ ์ด์จ์ ๋ํด ๋ถํฌ๊ณผ์ฑ์ด๋ผ ์ด์จ์ด ๋ค์ด์ค๊ฑฐ๋ ๋๊ฐ๋ ๊ฑธ ๋ง๋๋ค. ๊ทธ๋ฐ๋ฐ ๋ด๋ฐ์ ์ ๋ฅ๊ฐ ์ฃผ์ ๋๋ฉด ์ฑ๋์ ๋ณํ๋ก ์ธํด ์ด์จ์ ์ด๋์ด ๊ฐ๋ฅํด ์ง๋ค. ์ด๋ ์ ํญ ์ญํ ์ ํ๋ค.
!https://github.com/jeshraghian/snntorch/blob/master/docs/_static/img/examples/tutorial2/2_3_passivemembrane.png?raw=true
LIF neuron model ์ ๋
์์์ ์๊ฐ์ ๋ฐ๋ผ $I(t)$๊ฐ neuron์ ์ฃผ์ ๋๋ค๊ณ ๊ฐ์ ์ด๋ ํค๋ฅดํํธํ ์ ๋ฅ๋ฒ์น(Kirchhoffโs Current Law)์ ์๊ฑฐํ์ฌ ์๋์ ๊ฐ๋ค.
\[I(t) = I_R(t)+I_C(t)\]์ด๋ ์ด์ ๋ฒ์น์ ์๊ฑฐํ์ฌ ๋ด๋ฐ ๋ด๋ถ,์ธ๋ถ ๋ง ์ฌ์ด์ ์ ์์ฐจ $V_m(t)$๋ ์ ํญ์ ํตํด ๊ตฌํ ์ ์๋ค.
\[V_m(t)=I_R(t)R\]์ปคํจ์ํด์ค $C$๋ ์ ์ฅ๋ ์ ํ $Q(t)$์ ๋ง ์ ์ $V_m(t)$ ์ฌ์ด์ ๋น๋ก์์ ์ด๋ค. ๊ทธ๋ฆฌ๊ณ ์ ํ์ ๋ณํ์จ์ ์ปคํจ์ํฐ์ ์ ๋ฅ์ด๋ค.
\[I_C(t)=C\cdot \frac{dV_m(t)}{dt}\]๋ฐ๋ผ์ $I(t)$์ ์๋์ ๊ฐ์ด ๋ํ๋ผ ์ ์๋ค.
\[I(t) = \frac{V_m(t)}{R} + C \cdot \frac{dV_m(t)}{dt}\]์ด๋ ํ๋ก์ ์๊ฐ์์ $\tau = RC$๋ก $V_m(t)$ํจ์์ ๊ทธ ๋ํจ์๊ฐ ๊ฐ์ ํํ๊ฐ ๋ ๋ ค๋ฉด ์๊ฐ์์ $\tau$๋ ์ง์์ ์ผ๋ก ๊ฐ์ํ๋ ํํ๋ฅผ ๊ฐ์ ธ์ผ ํ๋ค. ๋ฐ๋ผ์ $V_m(0) = V_0$ ์ด๊ณ ์ถ๊ฐ์ ์ธ ์ ๋ ฅ์ด ์๋ค๊ณ ๊ฐ์ ํ๋ฉด($I(t)=0$) ๋ฏธ๋ถ ๋ฐฉ์ ์์ ํด๋ ์๋์ ๊ฐ๋ค.
\[V_m(t)=V_0 \cdot e^{-\frac{t}{\tau}}\]!https://github.com/jeshraghian/snntorch/blob/master/docs/_static/img/examples/tutorial2/2_4_RCmembrane.png?raw=true
Forward Euler
Lapicqueโs LIF neuron model
- Without Stimulus
- Step inputs
- Pulse inputs
- Firing
- Spike inputs
- Reset Mechanisms