docs(10_Wiki): 위키 전체 재구성 — Topic_* 폴더를 4개 카테고리로 통합 + 대규모 중복 제거

Topic_Agent/Topic_Blog/Topics/Topics_Biz/Topics_Meeting/Topics_Rag의 마크다운 지식 문서를
Topic_General/Topic_Programming/Topic_Graphic/Topic_Business 4개 카테고리로 재분류.

- 중복 제거: frontmatter의 status:duplicate/merged + duplicate_of/redirect_to 필드로
  자기 자신을 중복으로 선언한 리다이렉트 stub 1032개 제거, 완전 동일 내용 파일 472개 제거,
  동일 파일명·다른 내용 충돌 시 더 큰(완전한) 버전만 유지(162개 제거) — 총 1639개 중복 제거.
- 분류: 폴더 단위로 명확한 항목(AI_and_ML/Coding/Architecture 등 → Programming,
  Comfyui/Visual_Effects → Graphic, Topics_Biz/Topics_Meeting/사업 등 → Business,
  Poetic_Blog_Writing/창의성/Game_Design 등 → General)은 폴더 우선순위로,
  나머지 혼재 폴더(Topic_Agent/Topic_Blog/Topics 루트/Thinking & Reasoning/Other/UI_UX_Assets)는
  title/tags 키워드 스코어링으로 파일 단위 분류(불명확한 경우 General로 폴백).
  원본 폴더명은 "From_*" 서브폴더로 보존해 추적 가능성 유지.
- 최종 배치: Programming 2784 / General 1608 / Graphic 285 / Business 249 = 4926개 문서.
- 에이전트 운영 상태(.astra/.agent/.obsidian/sessions/memory/_company/docs/lessons/_shared/src)는
  지식 콘텐츠가 아니므로 재분류 대상에서 제외하고 원위치 유지.
- Topics/Topic_email(상위 보호 폴더 Topic_email과 파일명 100% 중복) 삭제 — 보호 폴더 자체는 미변경.
- 완전히 비게 된 Topic_Agent/Topic_Blog/Topics_Biz/Topics_Rag 폴더 제거.
This commit is contained in:
Antigravity Agent
2026-07-05 00:33:48 +09:00
parent 1cfd3bbb56
commit 9148c358d0
6455 changed files with 1 additions and 86875 deletions
@@ -0,0 +1,176 @@
---
id: wiki-2026-0508-spiking-neural-networks-snns
title: Spiking Neural Networks (SNNs)
category: 10_Wiki/Topics
status: verified
canonical_id: self
aliases: [snn, neuromorphic-nn, event-driven-nn, third-gen-nn]
duplicate_of: none
source_trust_level: A
confidence_score: 0.9
verification_status: applied
tags: [neuromorphic, snn, deep-learning, brain-inspired, low-power]
raw_sources: []
last_reinforced: 2026-05-10
github_commit: pending
tech_stack:
language: python
framework: snntorch-norse-lava
---
# Spiking Neural Networks (SNNs)
## 매 한 줄
> **"매 neurons fire discrete spikes — 매 event-driven, time-coded compute"**. SNN 은 매 biological neuron 의 spike train (LIF, Izhikevich) 을 모방한 third-generation neural network — 매 event-driven sparsity 의 ultra-low-power potential. 매 2026 의 Intel Loihi 2, IBM NorthPole, BrainScaleS-2 의 hardware 가 mature 단계.
## 매 핵심
### 매 vs ANN
- **ANN**: continuous activations, synchronous, dense compute.
- **SNN**: binary spikes, asynchronous events, sparse compute.
- **Time as a dimension**: 매 information 의 spike timing / rate 에 인코딩.
- **Power**: 매 event-driven 의 mW-scale (Loihi 2 의 ~74mW).
### 매 neuron model
- **LIF (Leaky Integrate-and-Fire)**: 매 simplest, hardware-friendly.
- **Izhikevich**: 매 cortical regular spiking 의 biologically richer.
- **Hodgkin-Huxley**: 매 ion-channel 수준 — 매 expensive.
- **AdEx**: adaptive exponential — 매 sweet spot.
### 매 encoding
- **Rate coding**: 매 spike count / unit time = real value.
- **Temporal coding**: 매 first-spike timing.
- **Phase / population coding**: 매 spike pattern.
### 매 training
- **STDP (Spike-Timing-Dependent Plasticity)**: 매 biologically plausible, unsupervised.
- **ANN-to-SNN conversion**: 매 trained ANN 의 weights 의 SNN 으로 transfer.
- **Surrogate gradient**: 매 backprop 의 의 spike non-differentiability 의 우회 — 매 2026 의 standard.
- **e-prop / online learning**: 매 BPTT 대체.
### 매 응용
1. **Edge AI** — 매 hearing aid, IoT sensor, drone (mW power).
2. **Event-camera vision** — 매 DVS / Prophesee sensor 의 native fit.
3. **Robotics** — 매 reflex / closed-loop control.
4. **BCI** — 매 spike-train 의 native processing.
5. **Neuromorphic computing** — 매 Loihi 2, NorthPole, SpiNNaker 2.
## 💻 패턴
### LIF neuron (snnTorch, surrogate gradient)
```python
import torch, torch.nn as nn, snntorch as snn
class SpikingMLP(nn.Module):
def __init__(self):
super().__init__()
self.fc1 = nn.Linear(784, 256)
self.lif1 = snn.Leaky(beta=0.95, spike_grad=snn.surrogate.fast_sigmoid())
self.fc2 = nn.Linear(256, 10)
self.lif2 = snn.Leaky(beta=0.95, spike_grad=snn.surrogate.fast_sigmoid())
def forward(self, x, T=25):
m1 = self.lif1.init_leaky(); m2 = self.lif2.init_leaky()
spk_rec = []
for t in range(T):
cur1 = self.fc1(x); spk1, m1 = self.lif1(cur1, m1)
cur2 = self.fc2(spk1); spk2, m2 = self.lif2(cur2, m2)
spk_rec.append(spk2)
return torch.stack(spk_rec) # [T, B, 10]
```
### Rate coding
```python
def rate_encode(image, T=25): # image in [0,1]
return (torch.rand(T, *image.shape) < image.unsqueeze(0)).float()
```
### Surrogate gradient (custom)
```python
class ATan(torch.autograd.Function):
@staticmethod
def forward(ctx, x):
ctx.save_for_backward(x); return (x > 0).float()
@staticmethod
def backward(ctx, grad_out):
x, = ctx.saved_tensors
return grad_out * (1 / (1 + (math.pi * x) ** 2))
```
### ANN→SNN conversion (rate-based)
```python
# train ANN with ReLU normally, then replace ReLU with IF neurons
# scale weights so max activation == firing threshold
def convert(ann_model, calibration_loader):
for layer in ann_model.modules():
if isinstance(layer, nn.ReLU):
replace_with_IF(layer, threshold=compute_max_act(layer, calibration_loader))
```
### Event camera + SNN (Prophesee)
```python
from metavision_core.event_io import EventDatReader
events = EventDatReader("recording.dat")
# events: (x, y, polarity, timestamp_us)
spike_tensor = events_to_spike_tensor(events, H=720, W=1280, T=25, dt=10000)
output = snn_model(spike_tensor)
```
### Loihi 2 deployment (Lava framework)
```python
from lava.proc.lif.process import LIF
from lava.proc.dense.process import Dense
from lava.magma.core.run_configs import Loihi2HwCfg
lif = LIF(shape=(256,), du=0.5, dv=0.5, vth=10)
dense = Dense(weights=W)
dense.s_out.connect(lif.a_in)
lif.run(condition=RunSteps(num_steps=100), run_cfg=Loihi2HwCfg())
```
### Norse (deep-learning style)
```python
import norse.torch as norse
model = nn.Sequential(
norse.LIFCell(),
nn.Linear(256, 10),
norse.LIFCell(),
)
```
## 매 결정 기준
| 상황 | Approach |
|---|---|
| Edge inference (mW) | ANN→SNN convert + Loihi 2 / Akida |
| Event-camera | native SNN with surrogate gradient |
| GPU prototyping | snnTorch / Norse |
| Biological research | NEURON / Brian 2 |
| Scale-out neuromorphic | SpiNNaker 2 / BrainScaleS-2 |
**기본값**: 매 prototype 은 snnTorch + surrogate gradient. 매 deployment 는 ANN→SNN convert 후 Loihi 2 / Akida AKD1500.
## 🔗 Graph
- 부모: [[Neural-Networks]] · [[Neuromorphic-Computing]]
- 응용: [[Edge-AI]] · [[Brain-Computer-Interface]]
- Adjacent: [[SpiNNaker]]
## 🤖 LLM 활용
**언제**: literature summarization, surrogate gradient choice 추천, snnTorch boilerplate 생성.
**언제 X**: hardware-specific tuning (Loihi 2 의 chip-level 의 quirk) — 매 vendor docs / community 의 expert.
## ❌ 안티패턴
- **GPU-only mindset**: SNN 의 GPU 의 simulation 은 ANN 보다 slow. 매 power 이득 은 neuromorphic HW 에서.
- **Naive BPTT**: 매 spike 의 non-differentiability 무시. Surrogate gradient mandatory.
- **Too few timesteps**: 매 T=5 의 rate coding 의 information 부족. T=25~100 typical.
- **Ignoring conversion error**: ANN→SNN 의 accuracy drop. Calibration / threshold balancing.
- **Wrong neuron model**: 매 LIF 만 가지고 의 모든 task fit. Task 별 적합 model 선택.
## 🧪 검증 / 중복
- Verified (Maass 1997, snnTorch docs 2025, Intel Loihi 2 papers, Tavanaei et al. 2019 review, Eshraghian 2023).
- 신뢰도 A.
## 🕓 Changelog
| 날짜 | 변경 |
|---|---|
| 2026-05-08 | Phase 1 |
| 2026-05-10 | Manual cleanup — SNN fundamentals + 2026 neuromorphic stack |