<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>mywebsite</title><link>https://steven-yl.github.io/mywebsite/</link><description>mywebsite</description><generator>Hugo -- gohugo.io</generator><language>zh-CN</language><managingEditor>steven@gmail.com (Steven)</managingEditor><webMaster>steven@gmail.com (Steven)</webMaster><copyright>This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.</copyright><lastBuildDate>Fri, 03 Apr 2026 00:00:00 +0800</lastBuildDate><atom:link href="https://steven-yl.github.io/mywebsite/index.xml" rel="self" type="application/rss+xml"/><item><title>深度学习中的常见归一化方法</title><link>https://steven-yl.github.io/mywebsite/norm/</link><pubDate>Wed, 01 Apr 2026 10:00:00 +0800</pubDate><author><name>Steven</name><uri>https://github.com/steven-yl</uri></author><guid>https://steven-yl.github.io/mywebsite/norm/</guid><description>深度学习中的常见归一化方法</description></item><item><title>总览：TorchCode 知识架构与学习路径</title><link>https://steven-yl.github.io/mywebsite/00_overview/</link><pubDate>Wed, 01 Apr 2026 10:00:00 +0800</pubDate><author><name>Steven</name><uri>https://github.com/steven-yl</uri></author><guid>https://steven-yl.github.io/mywebsite/00_overview/</guid><description>算子级练习项目的整体架构与推荐阅读顺序。</description></item><item><title>Analytic Diffusion Studio — 技术文档索引</title><link>https://steven-yl.github.io/mywebsite/00-index/</link><pubDate>Fri, 27 Mar 2026 10:00:00 +0800</pubDate><author><name>Steven</name><uri>https://github.com/steven-yl</uri></author><guid>https://steven-yl.github.io/mywebsite/00-index/</guid><description>Analytic Diffusion Studio — 技术文档索引</description></item><item><title>Analytic Diffusion Studio — 项目总览</title><link>https://steven-yl.github.io/mywebsite/01-overview/</link><pubDate>Fri, 27 Mar 2026 10:00:00 +0800</pubDate><author><name>Steven</name><uri>https://github.com/steven-yl</uri></author><guid>https://steven-yl.github.io/mywebsite/01-overview/</guid><description>Analytic Diffusion Studio — 项目总览</description></item><item><title>smalldiffusion 技术文档索引</title><link>https://steven-yl.github.io/mywebsite/00_index/</link><pubDate>Fri, 27 Mar 2026 10:00:00 +0800</pubDate><author><name>Steven</name><uri>https://github.com/steven-yl</uri></author><guid>https://steven-yl.github.io/mywebsite/00_index/</guid><description><![CDATA[<blockquote>
  <p>smalldiffusion 是一个轻量级扩散模型库，用不到 100 行核心代码实现了扩散模型的训练与采样。
本文档对项目进行全面技术解读，从整体架构到每个函数的实现细节。</p>

</blockquote><h2 id="文档结构" class="headerLink">
    <a href="#%e6%96%87%e6%a1%a3%e7%bb%93%e6%9e%84" class="header-mark"></a>文档结构</h2><table>
  <thead>
      <tr>
          <th>文件</th>
          <th>内容</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><a href="01_overview.md" rel="">01_overview.md</a></td>
          <td>项目总览：架构设计、模块关系、扩散模型数学基础</td>
      </tr>
      <tr>
          <td><a href="02_diffusion.md" rel="">02_diffusion.md</a></td>
          <td>核心模块：噪声调度、训练循环、采样算法 (<code>diffusion.py</code>)</td>
      </tr>
      <tr>
          <td><a href="03_data.md" rel="">03_data.md</a></td>
          <td>数据模块：数据集工具、玩具数据集 (<code>data.py</code>)</td>
      </tr>
      <tr>
          <td><a href="04_model_base.md" rel="">04_model_base.md</a></td>
          <td>模型基础：ModelMixin、预测模式修饰器、注意力机制、嵌入层 (<code>model.py</code>)</td>
      </tr>
      <tr>
          <td><a href="05_model_dit.md" rel="">05_model_dit.md</a></td>
          <td>Diffusion Transformer 模型 (<code>model_dit.py</code>)</td>
      </tr>
      <tr>
          <td><a href="06_model_unet.md" rel="">06_model_unet.md</a></td>
          <td>U-Net 模型 (<code>model_unet.py</code>)</td>
      </tr>
      <tr>
          <td><a href="07_examples.md" rel="">07_examples.md</a></td>
          <td>实战示例：从玩具模型到 Stable Diffusion</td>
      </tr>
  </tbody>
</table>
<h2 id="模块依赖关系" class="headerLink">
    <a href="#%e6%a8%a1%e5%9d%97%e4%be%9d%e8%b5%96%e5%85%b3%e7%b3%bb" class="header-mark"></a>模块依赖关系</h2><div class="code-block highlight is-open show-line-numbers  tw-group tw-my-2">
  <div class="
    
    tw-flex 
    tw-flex-row
    tw-flex-1 
    tw-justify-between 
    tw-w-full tw-bg-bgColor-secondary
    ">      
    <button 
      class="
        code-block-button
        tw-mx-2 
        tw-flex
        tw-flex-row
        tw-flex-1"
      aria-hidden="true">
          <div class="group-[.is-open]:tw-rotate-90 tw-transition-[transform] tw-duration-500 tw-ease-in-out print:!tw-hidden tw-w-min tw-h-min tw-my-1 tw-mx-1"><svg class="icon"
    xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!-- Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --><path d="M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"/></svg></div>
          <p class="tw-select-none !tw-my-1">text</p>]]></description></item><item><title>smalldiffusion 项目总览</title><link>https://steven-yl.github.io/mywebsite/01_overview/</link><pubDate>Fri, 27 Mar 2026 10:00:00 +0800</pubDate><author><name>Steven</name><uri>https://github.com/steven-yl</uri></author><guid>https://steven-yl.github.io/mywebsite/01_overview/</guid><description><![CDATA[<h2 id="11-项目定位" class="headerLink">
    <a href="#11-%e9%a1%b9%e7%9b%ae%e5%ae%9a%e4%bd%8d" class="header-mark"></a>1.1 项目定位</h2><p>smalldiffusion 是一个教学与实验导向的扩散模型库，核心训练和采样代码不到 100 行。它的设计目标是：</p>
<ul>
<li>提供可读、可理解的扩散模型实现</li>
<li>支持从 2D 玩具数据到 Stable Diffusion 级别的预训练模型</li>
<li>方便研究者快速实验新的采样算法和模型架构</li>
</ul>
<p>论文参考：<a href="https://arxiv.org/abs/2306.04848" target="_blank" rel="noopener noreferrer">Permenter and Yuan, arXiv:2306.04848</a></p>]]></description></item><item><title>KL 散度与离散流匹配中的广义 KL 损失</title><link>https://steven-yl.github.io/mywebsite/kl_div/</link><pubDate>Wed, 25 Mar 2026 00:00:00 +0800</pubDate><author><name>Steven</name><uri>https://github.com/steven-yl</uri></author><guid>https://steven-yl.github.io/mywebsite/kl_div/</guid><description>本文把 KL 散度相关的几个核心概念串起来，给出离散流匹配中广义 KL 损失的直观解释与 PyTorch 实现示例。</description></item><item><title>Loss Functions：系统化整理</title><link>https://steven-yl.github.io/mywebsite/loss_type/</link><pubDate>Wed, 25 Mar 2026 00:00:00 +0800</pubDate><author><name>Steven</name><uri>https://github.com/steven-yl</uri></author><guid>https://steven-yl.github.io/mywebsite/loss_type/</guid><description>本笔记从任务视角覆盖主流 Loss Functions，包括经典方法、现代变体以及实际组合策略，便于快速对照与选型。</description></item><item><title>todo</title><link>https://steven-yl.github.io/mywebsite/todo/</link><pubDate>Wed, 25 Mar 2026 00:00:00 +0800</pubDate><author><name>Steven</name><uri>https://github.com/steven-yl</uri></author><guid>https://steven-yl.github.io/mywebsite/todo/</guid><description>收集一个外部链接，后续用于整理与更新。</description></item><item><title>PyTorch lr曲线</title><link>https://steven-yl.github.io/mywebsite/lr_function/</link><pubDate>Tue, 24 Mar 2026 00:00:00 +0800</pubDate><author><name>Steven</name><uri>https://github.com/steven-yl</uri></author><guid>https://steven-yl.github.io/mywebsite/lr_function/</guid><description>lr曲线图</description></item></channel></rss>