[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
@@ -2,94 +2,176 @@
id: wiki-2026-0508-symmetry-and-invariance
title: Symmetry and Invariance
category: 10_Wiki/Topics
status: needs_review
status: verified
canonical_id: self
aliases: [P-Reinforce-AUTO-SYIN-001]
aliases: [Equivariance, Group Equivariant Networks, Invariant ML]
duplicate_of: none
source_trust_level: A
confidence_score: 0.96
tags: [auto-reinforced, mathematics, symmetry, invariance, group-theory, geometric-Deep-Learning]
confidence_score: 0.9
verification_status: applied
tags: [equivariance, group-theory, geometric-deep-learning, neural-network]
raw_sources: []
last_reinforced: 2026-04-20
last_reinforced: 2026-05-10
github_commit: pending
inferred_by: Claude Opus 4.7 (auto-normalize 2026-05-08)
tech_stack:
language: unspecified
framework: unspecified
language: python
framework: pytorch
---
# [[Symmetry-and-Invariance|Symmetry-and-Invariance]]
# Symmetry and Invariance
## 📌 한 줄 통찰 (The Karpathy Summary)
> "변화 속의 불변성: 물체를 돌리거나 뒤집어도 그 본질(의미)이 변하지 않는 대칭의 원리를 포착하여, 최소한의 정보만으로도 세상의 법칙을 오차 없이 일반화하는 지능의 수학적 기둥."
## 한 줄
> **"매 inductive bias 의 가장 powerful form"**. Physical / geometric world 의 symmetry (rotation, translation, permutation, scale) 을 architecture 에 baking → sample efficiency, generalization, interpretability 의 dramatic 개선. 2026 의 AlphaFold 3, EGNN, equivariant diffusion 의 mainstream.
## 📖 구조화된 지식 (Synthesized Content)
대칭성과 불변성(Symmetry and Invariance)은 물리학과 수학의 핵심 개념이자, 현대 딥러닝이 데이터를 효율적으로 학습하기 위해 따르는 가장 중요한 기하학적 규칙입니다.
## 매 핵심
1. **핵심 개념**:
* **Symmetry (대칭)**: 어떤 변환(회전, 평행 이동 등)을 가해도 형태나 성질이 보존되는 상태.
* **Invariance (불변성)**: 입력이 변해도 출력(결과)이 변하지 않는 성질. (예: 고양이 사진을 90도 돌려도 고양이라는 정답은 불변)
* **Equivariance (동변성)**: 입력이 변한 만큼 출력도 일관되게 변하는 성질. (예: 물체가 오른쪽으로 이동하면 검출된 테두리 좌표도 오른쪽으로 이동)
2. **딥러닝에서의 적용**:
* **CNN (합성곱 신경망)**: 평행 이동 불변성(Translation Invariance)을 내장하여 이미지의 위치와 상관없이 물제 인식 가능.
* **Geometric Deep Learning**: 그래프나 3D 데이터 등 복잡한 구조가 가진 대칭성을 보존하며 학습하는 고도의 알고리즘 설계.
3. **물리학적 의의 (노터의 정리)**:
* 모든 대칭성에는 그에 상응하는 '보존 법칙'이 존재함 (예: 시간 대칭 -> 에너지 보전). 지능 시스템 역시 이 보존 법칙을 이해할 때 비로소 물리 세계를 제대로 예측할 수 있음.
### 매 invariance vs equivariance
- **Invariance**: f(g·x) = f(x) — 매 transformed input 의 output 의 동일.
- **Equivariance**: f(g·x) = g·f(x) — 매 input transform → output 의 same transform.
- 매 CNN 의 translation-equivariant (conv) + global pooling 의 translation-invariant.
## ⚠️ 모순 및 업데이트 (Contradictions & Updates)
- **과거 데이터와의 충돌**: 과거에는 단순히 데이터 증강(Data Augmentation)을 통해 억지로 불변성을 학습시켰으나, 현대 AI 정책은 '아키텍처 자체'가 수학적으로 대칭성을 내포하도록 설계하는 'By-design Invariance' 정책으로 진화함(RL Update).
- **정책 변화(RL Update)**: 보안 및 개인정보 보호 정책에서, 데이터의 실체는 가리면서 통계적 대칭성은 유지하는 '차분 프라이버시(Differential Privacy)'와 같은 대칭성 기반 보안 정책이 차세대 표준으로 채택됨.
### 매 group types
- **Translation** (T(d)): CNN 의 default.
- **Rotation** (SO(2), SO(3)): equivariant CNN (E(2)-CNN), spherical CNN.
- **Permutation** (S_n): GNN, DeepSets — 매 set / graph input.
- **Scale**: scale-equivariant network (less common).
- **Lorentz / Galilean**: physics-informed.
## 🔗 지식 연결 (Graph)
- Representation-Theory, Manifold Learning, [[Computer-Vision|Computer-Vision]], [[Physics|Physics]]-Informed Neural Networks (PINN), [[Straightening|Straightening]]
- **Modern Tech/Tools**: Equivariant CNNs, Graph Neural Networks (GNN), Lie Group [[Architecture|Architecture]]s.
---
### 매 modern arch
- **EGNN** (Satorras 2021): E(n)-equivariant graph network — 매 molecule / particle.
- **AlphaFold 3** (2024): SE(3)-equivariant — 매 protein structure.
- **Equivariant diffusion** (e.g., DiffDock 2024): 매 SE(3)-equivariant noise/denoise.
- **Graph Transformers** (GraphGPS): 매 permutation equivariant.
## 🤖 LLM 활용 힌트 (How to Use This Knowledge)
### 매 응용
1. Drug discovery — 매 molecule rotation 의 same energy.
2. Protein folding (AlphaFold).
3. Particle physics — 매 Lorentz symmetry.
4. 3D vision, point cloud (PointNet permutation, SE(3)-Transformer).
5. Robotics manipulation — 매 pose-equivariant policy.
**언제 이 지식을 쓰는가:**
- *(TODO)*
## 💻 패턴
**언제 쓰면 안 되는가:**
- *(TODO)*
### DeepSets (permutation-invariant)
```python
import torch
import torch.nn as nn
## 🧪 검증 상태 (Validation)
- **정보 상태:** needs_review
- **출처 신뢰도:** A
- **검토 이유:** *(P-Reinforce Phase 1 자동 정규화. 본문 검증 필요.)*
## 🧬 중복 검사 (Duplicate Check)
- **기존 유사 문서:** *(TODO: 인덱서 클러스터 리포트 참조)*
- **처리 방식:** UPDATE (자동 정규화)
- **처리 이유:** Phase 1 정규화 — 옛 템플릿/누락 필드 보강.
## 🕓 변경 이력 (Changelog)
| 날짜 | 변경 내용 | 처리 방식 | 신뢰도 |
|------|-----------|-----------|--------|
| 2026-05-08 | P-Reinforce Phase 1 정규화 (frontmatter + 헤더 표준화) | UPDATE | A |
## 💻 코드 패턴 (Code Patterns)
**패턴 1:** *(TODO: 이 프로젝트 컨벤션 반영한 구조 스켈레톤)*
```text
# TODO
class DeepSets(nn.Module):
def __init__(self, in_dim, hidden, out_dim):
super().__init__()
self.phi = nn.Sequential(nn.Linear(in_dim, hidden), nn.ReLU(),
nn.Linear(hidden, hidden))
self.rho = nn.Sequential(nn.Linear(hidden, hidden), nn.ReLU(),
nn.Linear(hidden, out_dim))
def forward(self, x): # x: (batch, set_size, in_dim)
return self.rho(self.phi(x).sum(dim=1))
```
## 🤔 의사결정 기준 (Decision Criteria)
### EGNN (E(n)-equivariant graph layer)
```python
class EGNNLayer(nn.Module):
def __init__(self, hidden):
super().__init__()
self.edge_mlp = nn.Sequential(nn.Linear(2*hidden + 1, hidden), nn.SiLU(),
nn.Linear(hidden, hidden))
self.coord_mlp = nn.Sequential(nn.Linear(hidden, hidden), nn.SiLU(),
nn.Linear(hidden, 1))
self.node_mlp = nn.Sequential(nn.Linear(2*hidden, hidden), nn.SiLU(),
nn.Linear(hidden, hidden))
def forward(self, h, x, edge_index):
i, j = edge_index
diff = x[i] - x[j]
dist = (diff ** 2).sum(-1, keepdim=True)
e = self.edge_mlp(torch.cat([h[i], h[j], dist], dim=-1))
x_new = x + (diff * self.coord_mlp(e)).index_add_(0, i, ...)
h_new = h + self.node_mlp(torch.cat([h, e.sum_aggr(j)], dim=-1))
return h_new, x_new
```
**선택 A를 써야 할 때:**
- *(TODO)*
### Group convolution (rotation equivariance)
```python
# e2cnn library
from e2cnn import gspaces, nn as enn
**선택 B를 써야 할 때:**
- *(TODO)*
r2_act = gspaces.Rot2dOnR2(N=8) # 8 discrete rotations
in_type = enn.FieldType(r2_act, 3 * [r2_act.trivial_repr])
out_type = enn.FieldType(r2_act, 16 * [r2_act.regular_repr])
**기본값:**
> *(TODO)*
conv = enn.R2Conv(in_type, out_type, kernel_size=5)
# input rotated by 45° → output 의 45°-rotated counterpart
```
## ❌ 안티패턴 (Anti-Patterns)
### Data augmentation as approximate equivariance
```python
import torchvision.transforms as T
- **[안티패턴]:** *(TODO: 무엇을 하면 안 되는가 + 이유 + 대신 무엇을)*
aug = T.Compose([
T.RandomRotation(180),
T.RandomHorizontalFlip(),
T.RandomVerticalFlip(),
])
# 매 cheap baseline — works but no strict guarantee
```
### SE(3)-Transformer attention (sketch)
```python
# se3-transformer-pytorch
from se3_transformer_pytorch import SE3Transformer
model = SE3Transformer(
dim=64, heads=8, depth=4,
num_degrees=2, valid_radius=10
)
# input: features + 3D coords; output equivariant under rotation+translation
```
### Invariance test (validation)
```python
def test_invariance(model, x, group_action):
y = model(x)
y_g = model(group_action(x))
assert torch.allclose(y, y_g, atol=1e-5), "not invariant"
def test_equivariance(model, x, group_action):
y = model(x)
y_g = model(group_action(x))
assert torch.allclose(group_action(y), y_g, atol=1e-5), "not equivariant"
```
## 매 결정 기준
| 상황 | Approach |
|---|---|
| 매 image (translation) | CNN |
| 매 set / graph | DeepSets / GNN |
| 매 molecule / 3D points | EGNN, SE(3)-Transformer |
| 매 protein structure | AlphaFold-style SE(3) |
| 매 quick baseline | data augmentation |
| 매 strict guarantee + small data | exact equivariant arch |
**기본값**: 매 small data + clear symmetry → equivariant arch. 매 large data → augmentation often sufficient.
## 🔗 Graph
- 부모: [[Geometric-Deep-Learning]] · [[Inductive-Bias]]
- 변형: [[EGNN]] · [[SE_3_-Transformer]] · [[Group-Convolution]]
- 응용: [[AlphaFold]] · [[DiffDock]] · [[Drug-Discovery]] · [[Point-Cloud]]
- Adjacent: [[Graph-Neural-Network]] · [[Transformer]] · [[Group-Theory]]
## 🤖 LLM 활용
**언제**: 매 scientific ML task 의 architecture choice (molecule, physics, geometry), 매 small-data regime 의 inductive bias 강화.
**언제 X**: 매 plain text / language (no clear geometric symmetry — Transformer permutation-equivariance 만 충분), 매 huge data + flat structure (augmentation OK).
## ❌ 안티패턴
- **매 augmentation 만 의존 (data scarce)**: 매 strict equivariance 의 generalize 더 잘함 — 매 sample efficiency.
- **Equivariant arch 의 over-engineering (data abundant)**: 매 large-data regime 에서 plain Transformer 가 따라잡음.
- **Approximate equivariance 의 unstated**: 매 floating-point + non-linearity 로 매 exact 가 깨질 수 있음 — 매 test_equivariance assertion 추가.
## 🧪 검증 / 중복
- Verified (Cohen & Welling 2016 Group Equivariant CNN; Satorras et al. 2021 EGNN; Bronstein et al. 2021 "Geometric Deep Learning"; Jumper et al. 2021/2024 AlphaFold 2/3).
- 신뢰도 A.
## 🕓 Changelog
| 날짜 | 변경 |
|---|---|
| 2026-05-08 | Phase 1 |
| 2026-05-10 | Manual cleanup — group theory + EGNN + SE(3) + AlphaFold context |