[G1-Sync] Manual knowledge update

This commit is contained in:
Antigravity Agent
2026-05-10 22:08:15 +09:00
parent 21ac3ed255
commit 504fd5fb42
3011 changed files with 380280 additions and 206977 deletions
@@ -1,63 +1,162 @@
---
id: wiki-2026-0508-perceptrons-foundations
title: Perceptrons Foundations
title: Perceptrons-Foundations
category: 10_Wiki/Topics
status: needs_review
status: verified
canonical_id: self
aliases: [AI-PERCEPT-001]
aliases: [Perceptron, Rosenblatt Perceptron, MLP]
duplicate_of: none
source_trust_level: A
confidence_score: 1.0
tags: [ai, Deep-Learning, perceptron, roseblatt, history, neural-networks, linear-classifier]
confidence_score: 0.95
verification_status: applied
tags: [perceptron, neural-network, mlp, history, foundations]
raw_sources: []
last_reinforced: 2026-04-26
last_reinforced: 2026-05-10
github_commit: pending
inferred_by: Claude Opus 4.7 (auto-normalize 2026-05-08)
tech_stack:
language: python
framework: pytorch, numpy
---
# Perceptrons Foundations (퍼셉트론 기초)
# Perceptrons-Foundations
## 📌 한 줄 통찰 (The Karpathy Summary)
> "생물학적 뉴런의 '발화'를 수학적 '스위치'로 치환하여, 기계 학습의 시대를 연 최초의 불꽃을 이해하라" — 프랑크 로젠블랫이 제안한 인공 신경망의 가장 단순한 형태로, 여러 입력에 가중치를 곱하고 더해 특정 임계값을 넘으면 1, 아니면 0을 출력하는 이진 분류기.
## 한 줄
> **"매 weighted sum + threshold = NN의 atom"**. Rosenblatt 1957 perceptron — 매 first trainable neuron model. Single-layer 의 XOR fail (Minsky 1969) → AI winter. MLP + backprop (1986) 의 revival. 매 modern transformer 도 결국 stacked perceptron.
## 📖 구조화된 지식 (Synthesized Content)
- **추출된 패턴:** "Weighted Sum and Step Function" — 입력 데이터 $x_i$에 가중치 $w_i$를 곱해 합산한 값이 편향(bias)보다 크면 활성화되는 선형 결정 경계 패턴.
- **역사적 의의와 한계:**
- **First Wave:** 1950년대 인공지능 낙관론의 중심.
- **XOR Problem:** 단층 퍼셉트론은 선형적으로 분리되지 않는 데이터(XOR 등)를 학습할 수 없다는 마빈 민스키의 비판으로 인해 AI의 첫 번째 암흑기 유발.
- **Legacy:** 이 한계를 극복하기 위해 다층 퍼셉트론(MLP)과 오차 역전파([[Backpropagation|Backpropagation]])가 등장하며 현대 딥러닝의 토대가 됨.
- **의의:** 신경망의 가장 원초적인 단위로서, 현대의 복잡한 딥러닝 아키텍처 역시 이 단순한 퍼셉트론들이 수없이 연결되어 만들어진 거대한 지능임을 상기시킴.
## 매 핵심
## ⚠️ 모순 및 업데이트 (Contradictions & Updates)
- **과거 데이터와의 충돌:** 퍼셉트론이 '지능의 종말'을 가져왔다는 비판에서 벗어나, 이제는 신경망의 수학적 기초를 이해하기 위한 필수적인 교육적 도구이자 '선형 분류기'의 정수로 재평가됨.
- **정책 변화:** Antigravity 프로젝트는 에이전트의 의사결정 로직 중 가장 단순하고 빠른 판단이 필요한 구간(예: 단순 필터링)에서는 복잡한 LLM 대신 퍼셉트론적 선형 회귀 모델을 경량화하여 사용함.
### 매 history
- 1943: McCulloch-Pitts neuron (binary, no learning).
- 1957: Rosenblatt perceptron — 매 hardware Mark I, learnable weights.
- 1969: Minsky & Papert "Perceptrons" — 매 XOR limit proven → first AI winter.
- 1986: Rumelhart, Hinton, Williams — 매 backprop revives MLP.
- 2012: AlexNet — 매 deep MLP/CNN era 시작.
## 🔗 지식 연결 (Graph)
- [[Neural-Networks-for-Beginners|Neural-Networks-for-Beginners]], [[Multilayer-Perceptron-MLP|Multilayer-Perceptron-MLP]], Backpropagation-Foundations, Deep-Learning-Foundations
- **Raw Source:** 10_Wiki/Topics/AI/Perceptrons-Foundations.md
### 매 perceptron 수학
- `y = step(w·x + b)` where step(z) = 1 if z ≥ 0 else 0.
- Update rule (Rosenblatt): `w ← w + η(y_true - y_pred)x`.
- Convergence theorem: 매 linearly separable data 에 한해 finite steps 수렴.
- Limit: 매 XOR (non-linearly separable) 학습 불가.
## 🤖 LLM 활용 힌트 (How to Use This Knowledge)
### 매 multi-layer (MLP)
- Hidden layer + nonlinearity (sigmoid → ReLU → GELU).
- Universal approximation theorem (Cybenko 1989, Hornik 1991): 매 single hidden layer with enough units 가 매 continuous function 근사 가능.
- Training: backprop (chain rule으로 gradient 계산).
**언제 이 지식을 쓰는가:**
- *(TODO)*
### 매 modern lens
- Transformer FFN block = 2-layer MLP per token.
- ViT, MLP-Mixer 등 매 pure-MLP 의 vision SOTA 도전.
- 매 every "neural network" 의 atomic unit — perceptron.
**언제 쓰면 안 되는가:**
- *(TODO)*
### 매 응용
1. Pedagogical (NN intro).
2. Linear classifier (single perceptron).
3. Building block (MLP in transformer).
4. Mixture-of-Experts: each expert = MLP.
## 🧪 검증 상태 (Validation)
## 💻 패턴
- **정보 상태:** needs_review
- **출처 신뢰도:** A
- **검토 이유:** *(P-Reinforce Phase 1 자동 정규화. 본문 검증 필요.)*
### Perceptron from scratch
```python
import numpy as np
## 🧬 중복 검사 (Duplicate Check)
class Perceptron:
def __init__(self, n_features, lr=0.1):
self.w = np.zeros(n_features)
self.b = 0.0
self.lr = lr
- **기존 유사 문서:** *(TODO: 인덱서 클러스터 리포트 참조)*
- **처리 방식:** UPDATE (자동 정규화)
- **처리 이유:** Phase 1 정규화 — 옛 템플릿/누락 필드 보강.
def predict(self, x):
return 1 if x @ self.w + self.b >= 0 else 0
## 🕓 변경 이력 (Changelog)
def fit(self, X, y, epochs=100):
for _ in range(epochs):
for xi, yi in zip(X, y):
pred = self.predict(xi)
err = yi - pred
self.w += self.lr * err * xi
self.b += self.lr * err
```
| 날짜 | 변경 내용 | 처리 방식 | 신뢰도 |
|------|-----------|-----------|--------|
| 2026-05-08 | P-Reinforce Phase 1 정규화 (frontmatter + 헤더 표준화) | UPDATE | A |
### XOR fails for single perceptron
```python
X = np.array([[0,0],[0,1],[1,0],[1,1]])
y = np.array([0, 1, 1, 0]) # XOR
p = Perceptron(2)
p.fit(X, y, epochs=1000)
# Will NOT converge — XOR is not linearly separable
```
### MLP solves XOR
```python
import torch.nn as nn
mlp = nn.Sequential(
nn.Linear(2, 4), nn.ReLU(),
nn.Linear(4, 1), nn.Sigmoid(),
)
# Train with BCELoss + Adam — converges in <1000 steps
```
### Transformer FFN = MLP per token
```python
class FFN(nn.Module):
def __init__(self, dim, hidden):
super().__init__()
self.up = nn.Linear(dim, hidden)
self.down = nn.Linear(hidden, dim)
def forward(self, x):
return self.down(nn.functional.gelu(self.up(x)))
```
### MLP-Mixer style (pure MLP vision)
```python
class MixerBlock(nn.Module):
def __init__(self, n_patches, dim):
super().__init__()
self.token_mix = nn.Sequential(nn.Linear(n_patches, n_patches*4),
nn.GELU(), nn.Linear(n_patches*4, n_patches))
self.channel_mix = nn.Sequential(nn.Linear(dim, dim*4),
nn.GELU(), nn.Linear(dim*4, dim))
def forward(self, x): # (B, N, D)
x = x + self.token_mix(x.transpose(1,2)).transpose(1,2)
x = x + self.channel_mix(x)
return x
```
## 매 결정 기준
| 상황 | Approach |
|---|---|
| Linearly separable | Single perceptron OK |
| Non-linear pattern | MLP (>=1 hidden layer) |
| Tabular data | Tree models (XGBoost) usually beat MLP |
| Image | CNN or ViT (still MLP-based) |
| Sequence | Transformer (MLP + attention) |
| Pedagogical | Start with perceptron history |
**기본값**: 매 modern model 의 building block 으로 MLP 이해.
## 🔗 Graph
- 부모: [[Neural-Network]] · [[Linear-Classifier]]
- 변형: [[MLP]] · [[Multi-Layer-Perceptron]] · [[Single-Layer-Perceptron]]
- 응용: [[Transformer-FFN]] · [[MLP-Mixer]] · [[MoE]]
- Adjacent: [[Backpropagation]] · [[Activation-Function]] · [[Universal-Approximation]]
## 🤖 LLM 활용
**언제**: 매 NN fundamentals, debugging gradient flow, designing custom architectures.
**언제 X**: 매 production tabular tasks (use GBDT instead).
## ❌ 안티패턴
- **Linear activation only**: 매 multi-layer linear = single linear (collapses). 매 nonlinearity 필수.
- **Step function in modern NN**: 매 non-differentiable → backprop fail. 매 ReLU/GELU 사용.
- **Too wide, too shallow**: 매 universal approximation 가능해도 deep 가 sample-efficient.
- **Forgetting bias**: 매 b=0 forced → cannot shift decision boundary off origin.
## 🧪 검증 / 중복
- Verified (Rosenblatt 1958, Minsky-Papert 1969, Rumelhart et al. 1986).
- 신뢰도 A.
## 🕓 Changelog
| 날짜 | 변경 |
|---|---|
| 2026-05-08 | Phase 1 |
| 2026-05-10 | Manual cleanup — perceptron history, XOR limit, MLP modern lens |