구축 방법 — Diffusion · v1.0 · 2026-10-27
■ 방법
- 탭 5개: Forward Process / Noise Prediction / Reverse Process / Fewer Steps (DDIM) / Image Diffusion Models. 예전 단독 페이지(diffusion.aileelab.com)의 체험을 탭마다 나눠 실었고, 탭마다 개요·체험·요약·참고문헌을 둠
- 학습 모델: 2차원 점 분포를 배우는 DDPM. 신경망이 섞인 노이즈 ε를 예측, 평균 제곱 오차 손실
- MLP 입력 18(좌표 2 + 시간 사인 임베딩 16) → 128 → 128 → 128 → 2, SiLU · 파라미터 35,714개
- 노이즈 일정: 코사인, 100단계. 생성: DDPM 100단계, DDIM 5·10·25·100단계(x₀ 추정을 ±2로 자름)
- 직접 학습 · 사용자 브라우저의 Web Worker(CPU) · 순수 JavaScript, 역전파 직접 구현 · Adam 학습률 0.002 → 0.0002 코사인 · 묶음 256점 · 2,000단계 · 시드 1 (모두 정한 값)
- 기준 수치 실행 20261025T024427Z · Node 22.23
- LLM 없음
■ 데이터
- 예시 모양 4가지(하트·나선·두 개의 달·점 무더기 8개) · 코드로 생성 · 각 1,000점, 생성 시드 11
- 성격: 합성. 직접 그리기는 사용자가 찍은 점(150개 이상)
- 사용자 입력: 그린 점은 브라우저 안에서만 쓰고 저장하지 않음
■ 검증
- 지표: 대칭 챔퍼 거리(서로 가장 가까운 점까지 거리의 양방향 평균). 그린 점 1,000개 vs 같은 모양의 새 표본 1,000개(생성 시드 99)
- 하트: DDPM 100 0.032 / DDIM 25 0.034 / DDIM 5 0.076 / 가우시안 하나 0.123 / 노이즈 그대로 0.281 / 새 표본끼리(바닥값) 0.012
- 나선: 0.029 / 0.037 / 0.083 / 0.087 / 0.306 / 0.013
- 두 개의 달: 0.038 / 0.037 / 0.060 / 0.076 / 0.300 / 0.015
- 점 무더기 8개: 0.035 / 0.036 / 0.058 / 0.141 / 0.289 / 0.010
- 시드 1~3 DDPM 100: 하트 0.032~0.033, 나선 0.029~0.032, 두 개의 달 0.038~0.043, 점 무더기 0.035~0.041
- 미분 검사: MLP 해석적 기울기 vs 중앙 차분, 최대 상대오차 8×10⁻¹⁰
- 화면의 거리 수치는 학습 점과 비교(25단계, 500점). 헤드리스 Chromium 45초 학습: 668단계, 거리 0.067
- 학습 데이터와 평가 표본은 서로 다른 시드로 생성(분리함)
■ 범위
- 좌표 약 −1.6~1.6 평면의 2차원 점, 점 150~1,200개, 학습 2,000단계
■ 출처
- Ho, Jain & Abbeel (2020). Denoising diffusion probabilistic models. NeurIPS.
- Song, Meng & Ermon (2021). Denoising diffusion implicit models. ICLR.
- Nichol & Dhariwal (2021). Improved denoising diffusion probabilistic models. ICML.
- Rombach et al. (2022). High-resolution image synthesis with latent diffusion models. CVPR.
How it's built — Diffusion · v1.0 · 2026-10-27
■ Method
- 5 tabs: Forward Process / Noise Prediction / Reverse Process / Fewer Steps (DDIM) / Image Diffusion Models. The hands-on parts of the former stand-alone page (diffusion.aileelab.com) are split across tabs; each tab has an overview, hands-on part, summary and references
- Trained model: DDPM over a 2D point distribution. The network predicts the added noise ε, mean-squared-error loss
- MLP input 18 (2 coordinates + 16-dim sinusoidal time embedding) → 128 → 128 → 128 → 2, SiLU · 35,714 parameters
- Noise schedule: cosine, 100 steps. Sampling: DDPM with 100 steps, DDIM with 5, 10, 25, 100 steps (x₀ estimate clipped to ±2)
- Trained from scratch · in the visitor's browser, Web Worker (CPU) · plain JavaScript, hand-written backpropagation · Adam, learning rate 0.002 → 0.0002 cosine · batch of 256 dots · 2,000 steps · seed 1 (all set values)
- Reference run 20261025T024427Z · Node 22.23
- No LLM
■ Data
- Four example shapes (heart, spiral, two moons, eight clusters) · generated by code · 1,000 dots each, generator seed 11
- Nature: synthetic. Draw-your-own uses the visitor's dots (150 or more)
- User input: drawn dots stay in the browser and are not saved
■ Validation
- Metric: symmetric Chamfer distance (average nearest-dot distance, both directions). 1,000 generated dots vs a fresh sample of 1,000 dots from the same shape (generator seed 99)
- Heart: DDPM 100 0.032 / DDIM 25 0.034 / DDIM 5 0.076 / one Gaussian 0.123 / noise only 0.281 / two fresh samples (floor) 0.012
- Spiral: 0.029 / 0.037 / 0.083 / 0.087 / 0.306 / 0.013
- Two moons: 0.038 / 0.037 / 0.060 / 0.076 / 0.300 / 0.015
- Eight clusters: 0.035 / 0.036 / 0.058 / 0.141 / 0.289 / 0.010
- Seeds 1–3, DDPM 100: heart 0.032–0.033, spiral 0.029–0.032, two moons 0.038–0.043, clusters 0.035–0.041
- Gradient check: MLP analytic vs central difference, max relative error 8×10⁻¹⁰
- On-screen distances compare with the training dots (25 steps, 500 dots). Headless Chromium, 45 s of training: 668 steps, distance 0.067
- Training data and evaluation samples come from different seeds (separate)
■ Scope
- 2D dots in roughly −1.6 to 1.6, 150 to 1,200 dots, 2,000 training steps
■ Sources
- Ho, Jain & Abbeel (2020). Denoising diffusion probabilistic models. NeurIPS.
- Song, Meng & Ermon (2021). Denoising diffusion implicit models. ICLR.
- Nichol & Dhariwal (2021). Improved denoising diffusion probabilistic models. ICML.
- Rombach et al. (2022). High-resolution image synthesis with latent diffusion models. CVPR.
■ History
- 2026-10-27 · v1.0 · Released