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,166 @@
---
id: wiki-2026-0508-resnet-architectures
title: ResNet Architectures
category: 10_Wiki/Topics
status: verified
canonical_id: self
aliases: [ResNet, Residual Networks, Skip Connection]
duplicate_of: none
source_trust_level: A
confidence_score: 0.9
verification_status: applied
tags: [resnet, cnn, skip-connection, deep-learning, vision]
raw_sources: []
last_reinforced: 2026-05-10
github_commit: pending
tech_stack:
language: python
framework: pytorch
---
# ResNet Architectures
## 매 한 줄
> **"매 identity shortcut 의 deep network 의 가능"**. ResNet (He et al. 2015) 의 skip connection 으로 152-layer training 의 enable, ImageNet 우승. 2026 의 ConvNeXt-V2/Hiera 의 ResNet idea 의 Vision Transformer 의 hybrid.
## 매 핵심
### 매 핵심 idea
- **Residual block**: `y = F(x) + x` — 매 identity 의 default.
- **Vanishing gradient 의 mitigate**: gradient 의 skip 의 통해 직접 flow.
- **Deeper = better** (until 1000+ where diminishing).
- **Bottleneck (1x1 → 3x3 → 1x1)**: ResNet-50+ 의 efficiency.
### 매 Variants
- **ResNet-18 / 34**: basic block (no bottleneck).
- **ResNet-50 / 101 / 152**: bottleneck — 매 default backbone.
- **Wide ResNet**: wider, shallower.
- **ResNeXt**: grouped conv (cardinality).
- **DenseNet**: 매 모든 prev layer 의 concat (vs sum).
- **ConvNeXt (2022) / V2 (2023)**: ResNet 의 ViT-style modernize — depthwise conv, LayerNorm, GELU, 매 ImageNet SOTA 의 ViT 의 match.
- **Hiera (Meta, 2023)**: hierarchical ViT, ResNet 의 spirit.
### 매 응용
1. Image classification backbone (ImageNet, medical imaging).
2. Object detection (Faster R-CNN, RetinaNet 의 ResNet backbone).
3. Segmentation (U-Net + ResNet encoder).
4. Feature extraction for downstream (CLIP image encoder origin).
5. Diffusion model U-Net (residual 의 everywhere).
## 💻 패턴
### Residual block (PyTorch)
```python
import torch.nn as nn
class BasicBlock(nn.Module):
expansion = 1
def __init__(self, in_c, out_c, stride=1):
super().__init__()
self.conv1 = nn.Conv2d(in_c, out_c, 3, stride, 1, bias=False)
self.bn1 = nn.BatchNorm2d(out_c)
self.conv2 = nn.Conv2d(out_c, out_c, 3, 1, 1, bias=False)
self.bn2 = nn.BatchNorm2d(out_c)
self.shortcut = nn.Identity()
if stride != 1 or in_c != out_c:
self.shortcut = nn.Sequential(
nn.Conv2d(in_c, out_c, 1, stride, bias=False),
nn.BatchNorm2d(out_c),
)
def forward(self, x):
out = torch.relu(self.bn1(self.conv1(x)))
out = self.bn2(self.conv2(out))
out = out + self.shortcut(x) # 매 핵심
return torch.relu(out)
```
### Bottleneck block (ResNet-50+)
```python
class Bottleneck(nn.Module):
expansion = 4
def __init__(self, in_c, mid_c, stride=1):
super().__init__()
out_c = mid_c * self.expansion
self.conv1 = nn.Conv2d(in_c, mid_c, 1, bias=False)
self.bn1 = nn.BatchNorm2d(mid_c)
self.conv2 = nn.Conv2d(mid_c, mid_c, 3, stride, 1, bias=False)
self.bn2 = nn.BatchNorm2d(mid_c)
self.conv3 = nn.Conv2d(mid_c, out_c, 1, bias=False)
self.bn3 = nn.BatchNorm2d(out_c)
self.shortcut = nn.Identity()
if stride != 1 or in_c != out_c:
self.shortcut = nn.Sequential(
nn.Conv2d(in_c, out_c, 1, stride, bias=False),
nn.BatchNorm2d(out_c))
def forward(self, x):
out = torch.relu(self.bn1(self.conv1(x)))
out = torch.relu(self.bn2(self.conv2(out)))
out = self.bn3(self.conv3(out))
return torch.relu(out + self.shortcut(x))
```
### Pretrained ResNet-50 (torchvision)
```python
import torch
from torchvision.models import resnet50, ResNet50_Weights
weights = ResNet50_Weights.IMAGENET1K_V2
model = resnet50(weights=weights).eval().cuda()
preprocess = weights.transforms()
img = preprocess(load_image("cat.jpg")).unsqueeze(0).cuda()
with torch.no_grad():
logits = model(img)
print(weights.meta["categories"][logits.argmax(1).item()])
```
### ConvNeXt (2026 modern alt)
```python
from torchvision.models import convnext_base, ConvNeXt_Base_Weights
model = convnext_base(weights=ConvNeXt_Base_Weights.IMAGENET1K_V1)
# 매 ResNet 의 spirit, ViT-grade accuracy
```
### Fine-tune for custom task
```python
model = resnet50(weights=ResNet50_Weights.IMAGENET1K_V2)
for p in model.parameters(): p.requires_grad = False
model.fc = nn.Linear(model.fc.in_features, num_classes) # train only head
```
## 매 결정 기준
| 상황 | Approach |
|---|---|
| Quick CV baseline | ResNet-50 pretrained |
| SOTA accuracy | ConvNeXt-V2 / ViT-L / Hiera |
| Edge / mobile | MobileNetV3 / EfficientNet-Lite |
| Detection backbone | ResNet-50 + FPN, ConvNeXt for SOTA |
| Diffusion U-Net | Residual blocks (ResNet-style) |
**기본값**: ResNet-50 의 baseline, ConvNeXt-Base 의 production target.
## 🔗 Graph
- 부모: [[CNN]] · [[Deep Learning]]
- 응용: [[Image-Classification-Mastery]] · [[Object-Detection]] · [[Diffusion-Models]]
- Adjacent: [[Skip-Connection]]
## 🤖 LLM 활용
**언제**: ResNet implementation 의 explain, paper summarization (He 2015), debugging gradient flow.
**언제 X**: actual training (use PyTorch + GPU), benchmark numbers (verify on Papers with Code).
## ❌ 안티패턴
- **No skip connection 매 deep**: 매 50+ layers 의 vanishing gradient.
- **BatchNorm 의 small batch**: <16 의 broken — GroupNorm/LayerNorm 의 use.
- **Train from scratch 매 small data**: 매 pretrain 의 always.
- **Skip connection 의 add 의 다른 shape**: 매 1x1 conv projection 의 needed.
- **ResNet-152 매 mobile**: 60M params — MobileNet/EfficientNet 의 use.
## 🧪 검증 / 중복
- Verified (He et al. 2015 ResNet, Liu et al. 2022 ConvNeXt, torchvision docs).
- 신뢰도 A.
## 🕓 Changelog
| 날짜 | 변경 |
|---|---|
| 2026-05-08 | Phase 1 |
| 2026-05-10 | Manual cleanup — ResNet 매 ConvNeXt revival 의 connect |