You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(tutorials): add Runnable Code section to 3 paired tutorials
Bidirectional discoverability between tutorials and the new code/
contributions in docs/tutorials/code/:
- attention_tutorial.md (+ _en) -> mha.py, axial_attention.py
- flow_matching_tutorial.md (+ _en) -> flow_matching.py
- image_generation_systems_tutorial.md (+ _en) -> mmdit_block.py,
toy_mmdit_t2i_pipeline.py
Each tutorial gains a short "Runnable Code" section at the bottom
pointing to the paired scripts and to code/README.md. HTML
regenerated via tools/render_html.py with original title/eyebrow/
subtitle preserved.
<p>每个脚本默认 CPU 几秒跑完,自带 <code>assert</code> sanity check。完整说明见 <ahref="code/README.md"><code>code/README.md</code></a>。</p>
762
769
763
770
<footerclass="aris-footer">
764
771
Generated by <ahref="https://github.com/wanshuiyin/Auto-claude-code-research-in-sleep/blob/main/skills/render-html/SKILL.md">ARIS <code>/render-html</code></a> ·
<p>Each script runs on CPU in seconds with built-in <code>assert</code> sanity checks. Full overview in <ahref="code/README.md"><code>code/README.md</code></a>.</p>
762
769
763
770
<footerclass="aris-footer">
764
771
Generated by <ahref="https://github.com/wanshuiyin/Auto-claude-code-research-in-sleep/blob/main/skills/render-html/SKILL.md">ARIS <code>/render-html</code></a> ·
Generated by <ahref="https://github.com/wanshuiyin/Auto-claude-code-research-in-sleep/blob/main/skills/render-html/SKILL.md">ARIS <code>/render-html</code></a> ·
@@ -740,12 +742,17 @@ <h2 id="8-complete-runnable-example-2d-toy">§8 Complete runnable example (2D to
740
742
<divclass="callout callout-warn"><divclass="callout-title">Production additions (not in this pedagogical version)</div><p>engineering items to add before deployment.</p></div>
741
743
<ul><li><strong>EMA scheduler</strong>: decay closer to 1 in late training (e.g. 0.9999 → 0.99995)</li><li><strong>Gradient checkpointing</strong>: U-Net / DiT memory optimization</li><li><strong>Mixed precision</strong>: fp16 / bf16 + GradScaler</li><li><strong>Latent space</strong>: high-resolution images run FM in VAE latent space (LDM / SD3 / FLUX)</li><li><strong>Conditioning</strong>: text encoder (T5 / CLIP) + cross-attention or token concat</li><li><strong>Distributed</strong>: DDP / FSDP for multi-GPU</li><li><strong>Loss weighting</strong>: SD3 implicitly reweights via logit-normal $t$; EDM uses explicit SNR weighting</li></ul>
742
744
<p><strong>Flow Matching Quick Reference</strong> · Main references: Lipman et al. 2023 (Flow Matching), Liu et al. 2022 (Rectified Flow), Esser et al. 2024 (SD3 / MM-DiT)</p>
745
+
<hr/>
746
+
<h2id="runnable-code">📜 Runnable Code</h2>
747
+
<p>Minimal runnable PyTorch implementations of this tutorial's core concepts live in <ahref="code/"><code>docs/tutorials/code/</code></a>:</p>
748
+
<ul><li><ahref="code/flow_matching.py"><code>flow_matching.py</code></a> — Rectified Flow on 2D toy moons: train to regress <code>(x_1 - x_0)</code> velocity + Euler ODE sampling + trajectory viz</li></ul>
749
+
<p>Runs on CPU in ~30 seconds (matplotlib optional) with built-in sanity checks. Full overview in <ahref="code/README.md"><code>code/README.md</code></a>.</p>
743
750
744
751
<footerclass="aris-footer">
745
752
Generated by <ahref="https://github.com/wanshuiyin/Auto-claude-code-research-in-sleep/blob/main/skills/render-html/SKILL.md">ARIS <code>/render-html</code></a> ·
0 commit comments