<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://jerryzyc.github.io/feed.xml" rel="self" type="application/atom+xml" /><link href="https://jerryzyc.github.io/" rel="alternate" type="text/html" /><updated>2026-01-14T20:30:03+08:00</updated><id>https://jerryzyc.github.io/feed.xml</id><title type="html">Jerry Zhu Home</title><subtitle>关于机器人与智能系统的学习笔记，也记录更广泛的技术随笔、读书笔记与项目复盘。</subtitle><author><name>Jerry Zhu</name></author><entry><title type="html">Diffusion Policy: Visuomotor Policy Learning via Action Diffusion</title><link href="https://jerryzyc.github.io/paper/2026/01/13/paper-diffusion-policy.html" rel="alternate" type="text/html" title="Diffusion Policy: Visuomotor Policy Learning via Action Diffusion" /><published>2026-01-13T00:00:00+08:00</published><updated>2026-01-13T00:00:00+08:00</updated><id>https://jerryzyc.github.io/paper/2026/01/13/paper-diffusion-policy</id><content type="html" xml:base="https://jerryzyc.github.io/paper/2026/01/13/paper-diffusion-policy.html"><![CDATA[<h2 id="title--摘要">Title + 摘要</h2>
<p>本文提出 Diffusion Policy，将机器人 visuomotor policy 表示为<strong>条件去噪扩散过程</strong>，在动作空间中迭代采样生成动作序列。作者在 4 个基准、15 个任务上评估，平均提升 46.9%，并展示在真实机器人上的多任务操作能力。核心优势包括：对多模态动作分布的表达、适配高维动作序列、训练更稳定。为让扩散模型适用于实时控制，文中引入<strong>receding horizon</strong>、<strong>视觉条件化</strong>以及<strong>时间序列扩散 Transformer</strong>等关键设计。</p>

<h2 id="1-problem-setting任务场景假设">1. Problem Setting（任务/场景/假设）</h2>
<p>将模仿学习视作学习条件分布 $p(a|o)$。传统回归式策略在多模态行为、长时序相关以及精确控制方面表现不稳。本文目标是在视觉观测条件下，生成<strong>高维动作序列</strong>，并保持多模态表达与稳定训练。</p>

<h2 id="2-motivation--key-challenges">2. Motivation &amp; Key Challenges</h2>
<ul>
  <li>多模态行为：同一观测下存在多种合理动作。</li>
  <li>高维动作序列：单步动作无法表达稳定的时序行为。</li>
  <li>训练稳定性：能量模型或隐式策略往往需要负采样，训练不稳。</li>
</ul>

<h2 id="3-method-overview系统框图--文字解释">3. Method Overview（系统框图 + 文字解释）</h2>
<p>扩散策略在动作序列空间中进行 K 步去噪，并通过视觉观测条件化。</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Observation window O_t (last T_o steps)
        |
        +--&gt; Visual encoder -&gt; Obs Emb
                         |
Action noise A_t^K ------+--&gt; Diffusion Net (CNN+FiLM or Transformer)
                         |
                      A_t^0 (denoised action sequence)
        |
Execute first T_a actions, then receding horizon replan
</code></pre></div></div>

<h2 id="4-core-components逐模块带公式伪代码维度">4. Core Components（逐模块，带公式/伪代码/维度）</h2>

<h3 id="41-ddpm-去噪生成动作序列">4.1 DDPM 去噪生成（动作序列）</h3>
<p>从高斯噪声开始，迭代去噪得到动作序列：</p>

\[x_{k-1} = \alpha_k \left(x_k - \lambda_k \, \epsilon_\theta(x_k, k) + \mathcal{N}(0, \sigma_k^2 I)\right)\]

<p>可视为带噪的梯度下降：</p>

\[x' = x - \lambda \nabla E(x)\]

<p>其中 $\epsilon_\theta$ 近似梯度场。</p>

<h3 id="42-ddpm-训练目标">4.2 DDPM 训练目标</h3>
<p>随机选 $k$ 并对 $x_0$ 加噪：</p>

\[\mathcal{L} = \mathrm{MSE}\left(\epsilon_k, \epsilon_\theta(x_0 + \epsilon_k, k)\right)\]

<p>该目标等价于最小化 DDPM 生成分布与数据分布的 KL 上界。</p>

<h3 id="43-视觉条件化扩散策略建模">4.3 视觉条件化扩散（策略建模）</h3>
<p>策略学习条件分布 $p(A_t | O_t)$，修改去噪公式：</p>

\[A_{t,k-1} = \alpha_k \left(A_{t,k} - \lambda_k \, \epsilon_\theta(O_t, A_{t,k}, k) + \mathcal{N}(0, \sigma_k^2 I)\right)\]

<p>训练损失对应变为：</p>

\[\mathcal{L} = \mathrm{MSE}\left(\epsilon_k, \epsilon_\theta(O_t, A_{t,0} + \epsilon_k, k)\right)\]

<h3 id="44-receding-horizon-控制">4.4 Receding Horizon 控制</h3>
<p>在时间步 $t$，模型输入最近 $T_o$ 步观测，预测 $T_p$ 步动作，只执行前 $T_a$ 步：</p>

<ul>
  <li>$T_o$：观测窗口长度</li>
  <li>$T_p$：动作预测长度</li>
  <li>$T_a$：执行长度（每执行 $T_a$ 重新规划）</li>
</ul>

<p>这样既能维持时序一致性，又能保持对新观测的响应。</p>

<h3 id="45-网络结构选项">4.5 网络结构选项</h3>
<p><strong>CNN + FiLM</strong>：观测特征对每层卷积做通道级调制。<br />
<strong>Transformer</strong>：将观测嵌入输入交叉注意力层，动作 token 使用因果注意力以保持序列因果性。</p>

<h2 id="5-experiments--results结果表格消融失败案例">5. Experiments &amp; Results（结果表格、消融、失败案例）</h2>
<p><strong>总体表现</strong>：在 4 个基准 15 个任务上平均提升 46.9%，包括模拟与真实场景、2DoF 至 6DoF、刚体与流体任务。<br />
<strong>真实机器人</strong>：在 Push-T 与多种双臂任务中展示稳健性能。<br />
<strong>消融结论（文字版）</strong>：</p>
<ul>
  <li>较大的动作预测长度有助于平滑与多模态行为表达。</li>
  <li>视觉条件化显著提升推理速度，并使端到端训练更可行。</li>
  <li>训练稳定性优于隐式能量模型，减少负采样带来的不稳定。</li>
</ul>

<h2 id="6-discussion优势局限">6. Discussion（优势/局限）</h2>
<p><strong>优势</strong></p>
<ul>
  <li>多模态动作分布建模自然，避免回归平均化。</li>
  <li>直接预测动作序列，保持时间一致性。</li>
  <li>训练稳定，超参数敏感度低。</li>
</ul>

<p><strong>局限</strong></p>
<ul>
  <li>推理仍需多步去噪，实时性受步数 K 影响。</li>
  <li>需要较大演示数据量以覆盖复杂动作分布。</li>
</ul>

<h2 id="7-my-takeaways个人总结">7. My Takeaways（个人总结）</h2>
<p>1) 用扩散模型来建模动作序列，比单步回归更适合高维连续控制。<br />
2) 视觉条件化是关键工程点，能把扩散推理开销控制在可用范围。<br />
3) Receding horizon 让“长规划+短反馈”兼得，是部署到真实机器人的重要桥梁。</p>

<h2 id="references">References</h2>
<ul>
  <li>[1] Cheng Chi et al. <em>Diffusion Policy: Visuomotor Policy Learning via Action Diffusion</em>. arXiv:2303.04137v5, 2024.</li>
</ul>]]></content><author><name>Jerry Zhu</name></author><category term="paper" /><category term="diffusion" /><category term="imitation-learning" /><category term="manipulation" /><category term="visuomotor" /><category term="transformer" /><category term="receding-horizon" /><summary type="html"><![CDATA[Title + 摘要 本文提出 Diffusion Policy，将机器人 visuomotor policy 表示为条件去噪扩散过程，在动作空间中迭代采样生成动作序列。作者在 4 个基准、15 个任务上评估，平均提升 46.9%，并展示在真实机器人上的多任务操作能力。核心优势包括：对多模态动作分布的表达、适配高维动作序列、训练更稳定。为让扩散模型适用于实时控制，文中引入receding horizon、视觉条件化以及时间序列扩散 Transformer等关键设计。]]></summary></entry><entry><title type="html">Flying on Point Clouds with Reinforcement Learning</title><link href="https://jerryzyc.github.io/paper/2026/01/13/paper-flying-point-clouds-rl.html" rel="alternate" type="text/html" title="Flying on Point Clouds with Reinforcement Learning" /><published>2026-01-13T00:00:00+08:00</published><updated>2026-01-13T00:00:00+08:00</updated><id>https://jerryzyc.github.io/paper/2026/01/13/paper-flying-point-clouds-rl</id><content type="html" xml:base="https://jerryzyc.github.io/paper/2026/01/13/paper-flying-point-clouds-rl.html"><![CDATA[<h2 id="title--摘要">Title + 摘要</h2>
<p>本文研究如何用机载 3D 激光雷达点云与 sim-to-real 强化学习，实现四旋翼在复杂障碍环境中的低时延自主飞行。作者提出一种<strong>任务相关的点云表示</strong>：将历史点云在机体坐标系下按角度分区，用“最近点距离/未知区域距离”作为每个分区的数值输入，既保留细障碍感知，又降低维度以支持 RL 训练。策略以 50Hz 输出推力与角速度指令，结合动力学随机化与轻量级仿真，使仿真训练的策略能在真实无人机上绕过细小障碍并安全穿行。</p>

<h2 id="1-problem-setting任务场景假设">1. Problem Setting（任务/场景/假设）</h2>
<p>目标是让四旋翼仅依赖机载激光雷达与本体信息，在障碍环境中飞向目标点。策略学习为 RL：在部分可观测环境下，利用历史点云与状态估计，输出低层控制指令（推力与 bodyrates）。</p>

<h2 id="2-motivation--key-challenges">2. Motivation &amp; Key Challenges</h2>
<ul>
  <li>传统栅格/占据图对细障碍易“被稀释”，难以保留小目标。</li>
  <li>原始点云维度巨大，直接 RL 学习代价高且 sim-to-real 难。</li>
  <li>高速飞行要求低时延控制，不宜重依赖规划与跟踪层级。</li>
</ul>

<h2 id="3-method-overview系统框图--文字解释">3. Method Overview（系统框图 + 文字解释）</h2>
<p>核心是“点云分区表示 + MLP 策略”。点云通过历史帧对齐后分区编码，再与速度、姿态、目标方向等融合，输出推力与角速度。</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>History point clouds (k frames) -&gt; body frame align
      -&gt; angular partitions (n=3200) -&gt; per-bin distance/unknown
      -&gt; MLP encoder -&gt; fusion with v, q, g, last action
      -&gt; MLP policy -&gt; thrust T + bodyrates ω
</code></pre></div></div>

<h2 id="4-core-components逐模块带公式伪代码维度">4. Core Components（逐模块，带公式/伪代码/维度）</h2>

<h3 id="41-点云分区表示任务相关压缩">4.1 点云分区表示（任务相关压缩）</h3>
<p>将历史 k 帧点云对齐到当前时刻机体坐标系，把周围空间按角度划分为 n 个分区（n=3200，角分辨率约 4.5°）。每个分区取<strong>最近点距离</strong>，并截断到 10m。若分区无点，则用未知区域距离 $d_{unknown}$ 构造：</p>

\[x_i = 20 - d_{unknown}, \quad 0 &lt; d_{unknown} &lt; 10\]

<p>该表示既区分“已观测/未知”，又保留细障碍信息。</p>

<h3 id="42-观测与动作">4.2 观测与动作</h3>
<p><strong>观测</strong>：点云表示（3200 维） + 速度、姿态、相对目标方向、上一步动作等。<br />
<strong>动作</strong>：推力 $T$ 与角速度 $\omega = [\omega_x, \omega_y, \omega_z]$，50Hz 直接下发飞控。</p>

<h3 id="43-奖励函数">4.3 奖励函数</h3>
<p>奖励由多项组成：</p>

\[r = r_{forward} + r_{thrust} + r_{smooth} + r_{maxspeed} + r_z + r_{ESDF} + r_{collision} + r_{yaw}\]

<p>关键项包括：</p>

\[r_{forward} = \|p_{goal} - p\| - \|p_{goal} - p_{last}\|\]

\[r_{thrust} = \|T - g\|\]

\[r_{smooth} = \|\omega\| + \|a - a_{last}\|\]

\[r_{maxspeed} = -\exp(\max(0,\|v\| - v_{max})) + 1\]

\[r_{ESDF} = \lambda (1 - e^{-kd})\]

\[r_{yaw} = \frac{x_{body} \cdot v}{\|v\|}\]

<p>其中 $d$ 为最近障碍距离，$x_{body}$ 为机体 x 轴方向。</p>

<h3 id="44-网络结构">4.4 网络结构</h3>
<p>MLP 编码器将 3200 维外感知输入编码到 128 维隐状态，再与其他向量融合，输出 4 维动作。Actor/Critic 不共享权重。</p>

<h2 id="5-experiments--results结果与对比">5. Experiments &amp; Results（结果与对比）</h2>
<p>仿真评估显示该点云表示相比占据图输入更易于 PPO 从零开始学习，训练回报更稳定。对比 Fast-Planner、EGO-Planner 等系统，在不同速度约束下表现出更高成功率与更“容易”的轨迹。</p>

<h2 id="6-sim-to-real-实验">6. Sim-to-Real 实验</h2>
<p>真实飞行中可安全穿越箱体、电缆、稀疏树林等环境。作者强调：轻量级仿真 + 动力学随机化 + 雷达分区表示，使得策略能有效迁移到实体平台。</p>

<h2 id="7-discussion优势局限">7. Discussion（优势/局限）</h2>
<p><strong>优势</strong></p>
<ul>
  <li>点云表示兼顾细障碍感知与低维可学性。</li>
  <li>低层控制接口（推力/角速度）带来更高频控制能力。</li>
  <li>sim-to-real 成本低，训练效率高。</li>
</ul>

<p><strong>局限</strong></p>
<ul>
  <li>远距离小障碍可能被“放大”近似，存在信息损失。</li>
  <li>依赖稳定的本地状态估计与传感器标定。</li>
</ul>

<h2 id="8-reproducibility-checklist复现要点">8. Reproducibility Checklist（复现要点）</h2>
<ul>
  <li>RL：PPO，1024 环境并行采样。</li>
  <li>动力学随机化：推力/角速度扰动（约 ±10%/±8%），阻力系数大范围扰动。</li>
  <li>点云分区：n=3200，历史 k 帧融合，10Hz 输入构造。</li>
  <li>控制频率：50Hz 低层推力与 bodyrates。</li>
</ul>

<h2 id="9-my-takeaways个人总结">9. My Takeaways（个人总结）</h2>
<p>1) 对点云做“任务相关”的角度分区是关键，避免了通用下采样的盲区。<br />
2) 让 RL 直接输出低层控制指令，可减少规划/跟踪延迟，适配高速飞行。<br />
3) sim-to-real 的关键不是更复杂仿真，而是合理输入表示 + 适度随机化。</p>

<h2 id="references">References</h2>
<ul>
  <li>[1] Guangtong Xu et al. <em>Flying on Point Clouds with Reinforcement Learning</em>. arXiv:2503.00496, 2025.</li>
</ul>]]></content><author><name>Jerry Zhu</name></author><category term="paper" /><category term="drone" /><category term="lidar" /><category term="point-cloud" /><category term="reinforcement-learning" /><category term="sim2real" /><summary type="html"><![CDATA[Title + 摘要 本文研究如何用机载 3D 激光雷达点云与 sim-to-real 强化学习，实现四旋翼在复杂障碍环境中的低时延自主飞行。作者提出一种任务相关的点云表示：将历史点云在机体坐标系下按角度分区，用“最近点距离/未知区域距离”作为每个分区的数值输入，既保留细障碍感知，又降低维度以支持 RL 训练。策略以 50Hz 输出推力与角速度指令，结合动力学随机化与轻量级仿真，使仿真训练的策略能在真实无人机上绕过细小障碍并安全穿行。]]></summary></entry><entry><title type="html">World Model-based Perception for Visual Legged Locomotion</title><link href="https://jerryzyc.github.io/paper/2026/01/13/paper-wmp-locomotion.html" rel="alternate" type="text/html" title="World Model-based Perception for Visual Legged Locomotion" /><published>2026-01-13T00:00:00+08:00</published><updated>2026-01-13T00:00:00+08:00</updated><id>https://jerryzyc.github.io/paper/2026/01/13/paper-wmp-locomotion</id><content type="html" xml:base="https://jerryzyc.github.io/paper/2026/01/13/paper-wmp-locomotion.html"><![CDATA[<h2 id="title--摘要">Title + 摘要</h2>
<p>本文提出 World Model-based Perception (WMP)，通过世界模型把高维视觉观测压缩为可用于控制的低维隐变量，从而避免“特权信息教师-学生”框架的性能上限和信息鸿沟。方法使用 RSSM 在仿真中学习可预测未来感知的隐状态，并把该隐状态输入到视觉 locomotion 策略中。作者强调世界模型即使只用仿真训练，也能在真实机器人上预测合理的轨迹感知，帮助策略做决策。实验覆盖 Slope、Stair、Gap、Climb、Crawl、Tilt 等地形，WMP 在仿真中接近 Teacher 的回报，在真机 A1 上可通过更困难的间隙与障碍（如 Gap 85cm、Climb 55cm、Crawl 22cm），整体表现优于学生策略与其它基线。</p>

<h2 id="1-problem-setting任务场景假设">1. Problem Setting（任务/场景/假设）</h2>
<p>将视觉四足移动建模为 POMDP：</p>

\[\pi^* = \arg\max_\pi \mathbb{E}\left[\sum_{t=0}^\infty \gamma^t r(s_t, a_t)\right]\]

<p>观测由本体感觉与深度图构成，特权信息只在仿真可得：</p>

\[o_t := (o_t^{prop}, d_t)\]

\[s_t := (o_t, s_t^{pri})\]

<p>目标是在视觉部分可用、特权信息不可用的现实环境中，学习可迁移的控制策略。</p>

<h2 id="2-motivation--key-challenges">2. Motivation &amp; Key Challenges</h2>
<ul>
  <li>直接从像素端到端强化学习数据效率低，且前向相机需要记忆历史观测来感知脚下地形。</li>
  <li>特权学习的 teacher/student 有不可避免的性能差距，且特权信息设计难以泛化到复杂地形（例如 gap 边界、低矮遮挡）。</li>
  <li>动物直觉上会建立“世界模型”进行预测，暗示用模型压缩历史观测可能更自然、更高效。</li>
</ul>

<h2 id="3-method-overview系统框图--文字解释">3. Method Overview（系统框图 + 文字解释）</h2>
<p>WMP 采用“世界模型 + 策略”的单阶段学习。世界模型低频更新隐状态，策略高频输出动作。</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Depth Image d_t + Proprio o_t^prop
        |        |
        |        +--&gt; Encoder q_phi -&gt; z_t (posterior)
        |                              |
        +--&gt; RSSM f_phi --------------&gt; h_t (deterministic)
                        |              |
                        +--&gt; Prior p_phi(z_t | h_t)
                        +--&gt; Decoder p_phi(o_t | h_t, z_t)

Policy: a_{t+i} ~ pi_theta(o_{t+i}^prop, stopgrad(h_t)), i in [0, k-1]
Critic: V_psi(o_{t+i}, stopgrad(h_t), s_{t+i}^pri)
</code></pre></div></div>

<p>关键点：世界模型每 k 个控制步更新一次，节省感知与计算开销，并让隐状态承担“记忆/预测”功能。</p>

<h2 id="4-core-components逐模块带公式伪代码维度">4. Core Components（逐模块，带公式/伪代码/维度）</h2>

<h3 id="41-rssm-世界模型结构与变量">4.1 RSSM 世界模型（结构与变量）</h3>
<p>RSSM 由四部分组成：</p>

\[h_t = f_\phi(h_{t-k}, z_{t-k}, a_{t-k:t-1})\]

\[z_t \sim q_\phi(\cdot | h_t, o_t), \quad \hat{z}_t \sim p_\phi(\cdot | h_t)\]

\[\hat{o}_t \sim p_\phi(\cdot | h_t, z_t)\]

<ul>
  <li>$h_t$：确定性隐状态（GRU 更新）</li>
  <li>$z_t$：随机隐状态（posterior）</li>
  <li>$\hat{z}_t$：先验预测（prior）</li>
  <li>$\hat{o}_t$：重建观测</li>
</ul>

<h3 id="42-rssm-训练目标重建--kl">4.2 RSSM 训练目标（重建 + KL）</h3>
<p>对长度为 $L$ 的序列最小化：</p>

\[\mathcal{L}(\phi) = \mathbb{E}\left[\sum_{t=nk}^{nk+L} -\ln p_\phi(o_t | z_t, h_t) + \beta \, \mathrm{KL}\left(q_\phi(\cdot|h_t,o_t) \,\|\, p_\phi(\cdot|h_t)\right)\right]\]

<p>含义：</p>
<ul>
  <li>重建项确保 $z_t$ 包含足够观测信息；</li>
  <li>KL 项对齐 posterior 与 prior，使模型可在缺失观测时进行开环预测。</li>
</ul>

<h3 id="43-策略学习利用隐状态">4.3 策略学习（利用隐状态）</h3>
<p>策略在每个世界模型周期内复用同一 $h_t$：</p>

\[a_{t+i} \sim \pi_\theta(\cdot | o^{prop}_{t+i}, \mathrm{sg}(h_t)), \quad i \in [0, k-1]\]

<p>critic 允许访问特权信息以稳定训练（非对称 actor-critic）：</p>

\[v(s_{t+i}) = V_\psi(o_{t+i}, \mathrm{sg}(h_t), s^{pri}_{t+i})\]

<h3 id="44-关节控制pd">4.4 关节控制（PD）</h3>
<p>动作 $a_t$ 输出关节目标位置偏移，PD 控制为：</p>

\[\tau = K_p(q_d - q) + K_d(\dot{q}_d - \dot{q})\]

<p>其中 $q_d = q^{stand} + a_t$，$\dot{q}_d = 0$。</p>

<h3 id="45-奖励设计追踪--风格">4.5 奖励设计（追踪 + 风格）</h3>
<p>速度追踪奖励（简化的方向追踪）：</p>

\[r_{tracking} = \exp\left(\min(v_{xy}^{cmd}, v_{xy}^{cmd} + 0.1) - v_{xy}^2 / \sigma\right)\]

<p>风格奖励采用 AMP：</p>

\[r_{style}(s, s') = \max\left[0, 1 - 0.25(D_\psi(s, s') - 1)^2\right]\]

<p>判别器训练目标：</p>

\[\min_\psi \; \mathbb{E}_{(s,s')\sim D_{ref}}(D_\psi-1)^2 + \mathbb{E}_{(s,s')\sim \pi_\theta}(D_\psi+1)^2 + \frac{w_{gp}}{2}\mathbb{E}_{D_{ref}}\|\nabla_\psi D_\psi\|^2\]

<h2 id="5-experiments--results结果表格消融失败案例">5. Experiments &amp; Results（结果表格、消融、失败案例）</h2>
<p><strong>仿真结果</strong>：在 Slope、Stair、Gap、Climb、Tilt、Crawl 等地形上，WMP 的回报接近 Teacher，显著优于 Student 与 Blind。尤其在 Gap/Climb/Crawl 等需要提前感知的地形，Student 和 Blind 出现明显退化，WMP 仍保持稳定。</p>

<p><strong>真机结果</strong>（Unitree A1）：</p>
<ul>
  <li>Gap 85cm（约 2.1x 机身长度）</li>
  <li>Climb 55cm（约 2.2x 机身高度）</li>
  <li>Crawl 22cm（约 0.8x 机身高度）</li>
</ul>

<p>整体表明模型学到的隐状态可跨 sim-to-real，为控制提供有效的先验信息。</p>

<h2 id="6-ablations--sensitivity">6. Ablations &amp; Sensitivity</h2>
<ul>
  <li><strong>世界模型更新间隔 $k$</strong>：$k$ 越小仿真回报越高，但计算与感知成本更高；作者选择 $k=5$ 作为准确性与实时性的折中。</li>
  <li><strong>训练序列长度 $L$</strong>：约 1s 的历史就能达到较好效果，最终使用 6.4s 训练长度以覆盖长程依赖。</li>
  <li><strong>去除 depth 或 proprio</strong>：去除 depth 的 world model 相当于 blind 策略，性能显著下降，说明视觉建模是关键。</li>
</ul>

<h2 id="7-真实世界预测分析">7. 真实世界预测分析</h2>
<p>世界模型在真实数据上仍能预测合理的未来深度图像，尤其在关键障碍前表现良好，暗示 latent-space 的预测具有一定 sim-to-real 泛化能力。</p>

<h2 id="8-discussion优势局限">8. Discussion（优势/局限）</h2>
<p><strong>优势</strong></p>
<ul>
  <li>单阶段训练，避免 teacher/student 信息鸿沟。</li>
  <li>世界模型提供低维、可预测的隐状态，有效解决部分可观测问题。</li>
  <li>sim-to-real 迁移效果强，适用于复杂地形。</li>
</ul>

<p><strong>局限</strong></p>
<ul>
  <li>世界模型仍完全依赖仿真数据，现实差异可能导致预测偏差。</li>
  <li>模型频率与计算开销仍是部署瓶颈（需权衡 k）。</li>
  <li>没有使用模型进行 imagination rollout，训练效率可能仍受限于仿真采样。</li>
</ul>

<h2 id="9-my-takeaways个人总结">9. My Takeaways（个人总结）</h2>
<p>1) 视觉 locomotion 的关键不是更强的 CNN，而是“能预测的隐状态”来做时间对齐与先验推断。<br />
2) RSSM 的 KL 约束是保证开环预测能力的核心，实质上在逼近“短期世界模型”。<br />
3) 相比特权学习，WMP 把“记忆+预测”显式化，更贴近动物认知机制。<br />
4) 若要进一步提升，混合真实数据训练世界模型或引入基于模型的 imagination 可能是下一个方向。</p>

<h2 id="references">References</h2>
<ul>
  <li>[1] Hang Lai et al. <em>World Model-based Perception for Visual Legged Locomotion</em>. arXiv:2409.16784v1, 2024.</li>
</ul>]]></content><author><name>Jerry Zhu</name></author><category term="paper" /><category term="locomotion" /><category term="world-model" /><category term="mbrl" /><category term="rssm" /><category term="vision" /><category term="sim2real" /><summary type="html"><![CDATA[Title + 摘要 本文提出 World Model-based Perception (WMP)，通过世界模型把高维视觉观测压缩为可用于控制的低维隐变量，从而避免“特权信息教师-学生”框架的性能上限和信息鸿沟。方法使用 RSSM 在仿真中学习可预测未来感知的隐状态，并把该隐状态输入到视觉 locomotion 策略中。作者强调世界模型即使只用仿真训练，也能在真实机器人上预测合理的轨迹感知，帮助策略做决策。实验覆盖 Slope、Stair、Gap、Climb、Crawl、Tilt 等地形，WMP 在仿真中接近 Teacher 的回报，在真机 A1 上可通过更困难的间隙与障碍（如 Gap 85cm、Climb 55cm、Crawl 22cm），整体表现优于学生策略与其它基线。]]></summary></entry><entry><title type="html">Spatially-Enhanced Recurrent Memory for Long-Range Mapless Navigation</title><link href="https://jerryzyc.github.io/paper/2026/01/12/paper-sru-nav-rl.html" rel="alternate" type="text/html" title="Spatially-Enhanced Recurrent Memory for Long-Range Mapless Navigation" /><published>2026-01-12T00:00:00+08:00</published><updated>2026-01-12T00:00:00+08:00</updated><id>https://jerryzyc.github.io/paper/2026/01/12/paper-sru-nav-rl</id><content type="html" xml:base="https://jerryzyc.github.io/paper/2026/01/12/paper-sru-nav-rl.html"><![CDATA[<h2 id="title--摘要">Title + 摘要</h2>
<p>本文研究长程无地图导航的核心难题：在仅有前向深度观测的条件下，如何在动态视角变化中形成稳定的空间记忆，从而实现规划与避障。作者指出传统 RNN（LSTM/GRU）擅长时间记忆却不擅长空间配准，导致对历史观测的空间对齐能力不足，难以形成长期空间表征。为此提出 Spatially-Enhanced Recurrent Unit (SRU)，在标准门控循环单元中引入空间变换项，使其隐式学习视角变化下的空间对齐。基于 SRU，作者构建双层空间注意力 + SRU 的端到端 RL 架构，并结合深度编码器预训练、深度噪声模型、DML 与时序一致 Dropout 等训练策略，实现更稳定的长程导航训练。实验表明 SRU 在多种环境下成功率显著提升（整体约 +23.5%，对 EMHP 与堆叠历史观测基线提升约 29.6% 与 105.0%），并在真实场景中实现零样本 sim-to-real 部署。本文对“隐式记忆能否替代显式建图”的问题给出强有力的工程化答案。</p>

<h2 id="1-problem-setting任务场景假设">1. Problem Setting（任务/场景/假设）</h2>
<p>任务是长程、无地图导航。机器人仅能获取自身视角的深度图与少量本体信息，在未知环境中到达目标。形式化为 POMDP：</p>

\[(S, A, T, R, O, Z, \gamma)\]

<p>其中：</p>
<ul>
  <li>$S$ 为状态集合，$A$ 为动作空间</li>
  <li>$T$ 为状态转移，$R$ 为奖励</li>
  <li>$O$ 为观测集合，$Z$ 为观测模型</li>
  <li>$\gamma$ 为折扣因子</li>
</ul>

<p>由于观测是自我坐标系的局部深度图，单帧无法充分反映全局环境，必须依靠序列记忆形成可规划的隐式地图。</p>

<h2 id="2-motivation--key-challenges为什么难">2. Motivation &amp; Key Challenges（为什么难）</h2>
<ul>
  <li>纯端到端 RNN 虽能捕捉时间依赖，但难以进行空间配准，无法把不同视角下的观测对齐成一致空间表征。</li>
  <li>传统显式建图带来系统延迟与额外复杂度，不适合高速或复杂动力学平台。</li>
  <li>长程稀疏奖励会导致“晚出发”策略或过拟合局部策略，需要额外正则化。</li>
</ul>

<h2 id="3-method-overview系统框图--文字解释">3. Method Overview（系统框图 + 文字解释）</h2>
<p>架构采用“感知编码 + 双层注意力 + SRU 记忆 + MLP 动作头”。</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Depth Image --&gt; Encoder (RegNet+FPN) --&gt; Self-Attn --&gt; Cross-Attn --&gt; SRU --&gt; MLP --&gt; Action
                                  ^                       |
                                  |                       +-- Proprioceptive state + Goal
</code></pre></div></div>

<p>核心思想：注意力机制压缩并选择关键空间特征，SRU 负责长期隐式地图记忆与空间对齐，MLP 输出线速度与角速度控制指令。</p>

<h2 id="4-core-components逐模块带公式伪代码维度">4. Core Components（逐模块，带公式/伪代码/维度）</h2>

<h3 id="41-perception--encoder输入输出维度">4.1 Perception / Encoder（输入输出维度）</h3>
<p>输入为前向深度图 $I_t$，经过 RegNet + FPN 得到特征图：</p>

\[F_t \in \mathbb{R}^{C \times H \times W}\]

<p>其中 $C$ 为通道数，$H,W$ 为空间尺寸。随后经自注意力与交叉注意力压缩为：</p>

\[\hat{F}_t \in \mathbb{R}^{C \times 1}\]

<p><strong>变量表</strong></p>

<table>
  <thead>
    <tr>
      <th>符号</th>
      <th>含义</th>
      <th>维度</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>$I_t$</td>
      <td>深度图观测</td>
      <td>$H_0 \times W_0$</td>
    </tr>
    <tr>
      <td>$F_t$</td>
      <td>编码特征图</td>
      <td>$C \times H \times W$</td>
    </tr>
    <tr>
      <td>$\hat{F}_t$</td>
      <td>压缩特征</td>
      <td>$C \times 1$</td>
    </tr>
  </tbody>
</table>

<h3 id="42-spatial-attentionself-attn--cross-attn">4.2 Spatial Attention（Self-Attn + Cross-Attn）</h3>
<p>先对视觉特征做空间自注意力，再用机器人状态作为 Query 做交叉注意力压缩：</p>

\[\text{Attn}(Q,K,V) = \text{softmax}\left(\frac{QK^\top}{\sqrt{d}}\right)V\]

<ul>
  <li><strong>Self-Attn</strong>：$Q=K=V$ 来自 $F_t$ 的空间 token，增强全局空间关系。</li>
  <li><strong>Cross-Attn</strong>：$Q$ 来自本体状态 $o^{prop}_t$ 与目标位置 $p_t$，$K,V$ 来自视觉 token，用于“状态引导”的视觉压缩。</li>
</ul>

<p><strong>变量表</strong></p>

<table>
  <thead>
    <tr>
      <th>符号</th>
      <th>含义</th>
      <th>维度</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>$Q,K,V$</td>
      <td>注意力输入</td>
      <td>$d \times n$</td>
    </tr>
    <tr>
      <td>$o^{prop}_t$</td>
      <td>本体状态</td>
      <td>$d_{prop}$</td>
    </tr>
    <tr>
      <td>$p_t$</td>
      <td>相对目标</td>
      <td>$d_{goal}$</td>
    </tr>
  </tbody>
</table>

<h3 id="43-memory-sru对比-lstmgru-的关键改动">4.3 Memory (SRU)（对比 LSTM/GRU 的关键改动）</h3>
<p>SRU 在传统门控结构中引入空间变换项 $s_t$，用于隐式对齐观测视角：</p>

\[s_t = W_{xs} x_t + b_s\]

<p>SRU-LSTM 的核心更新为：</p>

\[g_t = \tanh\left(s_t \odot W_{xg} x_t + W_{hg} h_{t-1} + b_g\right)\]

<p>SRU-GRU 的候选状态为：</p>

\[\tilde{h}_t = \tanh\left(s_t \odot W_{xh} x_t + W_{hh}(r_t \odot h_{t-1}) + b_h\right)\]

<p>SRU-Ours 在此基础上增加门控修正以缓解饱和：</p>

\[r_t = i_t \odot \left(1 - (1 - f_t)^2\right) + (1 - i_t) \odot f_t^2\]

\[c_t = r_t \odot c_{t-1} + (1 - r_t) \odot g_t\]

<p><strong>直觉</strong>：$s_t$ 作为“视角变换因子”，让隐状态更新时显式考虑空间对齐，减少“把不同视角直接叠加”的误差。</p>

<h3 id="44-rl-training-design奖励dropoutdml非对称-actor-critic">4.4 RL Training Design（奖励、dropout、DML、非对称 actor-critic）</h3>
<p>总体奖励：</p>

\[r_t = \alpha_1 r_t^{task} - \alpha_2 r_t^{reg} - \alpha_3 r_t^{pen}\]

<p>其中任务奖励采用稀疏时间窗 + 随机检查机制：</p>

\[r_t^{task} = \frac{\mathbf{1}(t &gt; T_{max}-T_r \;\lor\; \text{random} &lt; \delta_{check})}{1 + \|p_t\|_\sigma}\]

<p>动作平滑正则：</p>

\[a_t^m = \lambda a_{t-1} + (1-\lambda) a_t\]

\[r_t^{reg} = \beta_1 \|a_t - a_t^m\| + \beta_2 \|j_t^{acc}\|\]

<p>惩罚项：</p>

\[r_t^{pen} = \eta_1 \mathbf{1}(\text{collision}) + \eta_2 \max(0, |\theta_t| - \theta_{safe})\]

<p><strong>训练策略</strong></p>
<ul>
  <li><strong>Asymmetric Actor-Critic</strong>：actor 接收噪声深度观测，critic 使用更稳定的状态信息，提升训练稳定性。</li>
  <li><strong>DML (Deep Mutual Learning)</strong>：双策略互蒸馏，使用 KL 散度作为额外正则，抑制早期陷入次优策略。</li>
  <li><strong>TC-Dropout</strong>：保持时间维度一致的 dropout mask，稳定序列记忆训练。</li>
</ul>

<h2 id="5-experiments--results结果表格消融失败案例">5. Experiments &amp; Results（结果表格、消融、失败案例）</h2>
<p><strong>结果概览</strong>：SRU 系列在多环境成功率显著提升，尤其在需要长程记忆的场景。</p>

<table>
  <thead>
    <tr>
      <th>Model</th>
      <th>Maze</th>
      <th>Pillar</th>
      <th>Stair</th>
      <th>Pit</th>
      <th>Overall</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>GRU</td>
      <td>68.1</td>
      <td>73.6</td>
      <td>35.7</td>
      <td>66.7</td>
      <td>61.0</td>
    </tr>
    <tr>
      <td>LSTM</td>
      <td>70.3</td>
      <td>78.2</td>
      <td>33.1</td>
      <td>72.7</td>
      <td>63.5</td>
    </tr>
    <tr>
      <td>SRU-GRU</td>
      <td>73.1</td>
      <td>78.8</td>
      <td>74.1</td>
      <td>74.8</td>
      <td>75.2</td>
    </tr>
    <tr>
      <td>SRU-LSTM</td>
      <td>75.9</td>
      <td>76.7</td>
      <td>79.3</td>
      <td>74.1</td>
      <td>76.5</td>
    </tr>
    <tr>
      <td>SRU-Ours</td>
      <td>76.0</td>
      <td>81.0</td>
      <td>82.8</td>
      <td>75.6</td>
      <td>78.9</td>
    </tr>
  </tbody>
</table>

<p><strong>失败案例（论文描述）</strong></p>
<ul>
  <li>LSTM 在迷宫中反复进入死胡同，无法回忆已走过的路径。</li>
  <li>LSTM 在坑洞环境中无法记住视野外的坑洞位置，导致再次掉入。</li>
</ul>

<h2 id="6-discussion优势局限">6. Discussion（优势/局限）</h2>
<p><strong>优势</strong></p>
<ul>
  <li>SRU 提升空间记忆能力，在长程导航中显著提高成功率。</li>
  <li>无需显式建图，降低系统延迟与复杂度。</li>
  <li>结合注意力与 DML/TC-Dropout，训练更稳定。</li>
</ul>

<p><strong>局限</strong></p>
<ul>
  <li>仍受循环记忆衰减影响，超长时间跨度记忆可能不足。</li>
  <li>依赖深度观测与预训练编码器，感知噪声仍会影响性能。</li>
</ul>

<h2 id="7-reproducibility-checklist超参数训练设置代码结构硬件">7. Reproducibility Checklist（超参数、训练设置、代码结构、硬件）</h2>
<ul>
  <li>环境：NVIDIA IsaacLab，包含迷宫、随机柱、楼梯、坑洞等场景</li>
  <li>观测：前向深度传感器（FoV 105° x 78°，10m 量程）</li>
  <li>控制频率：导航策略 5 Hz，底层控制 50 Hz</li>
  <li>策略：PPO + Asymmetric Actor-Critic</li>
  <li>正则化：DML、TC-Dropout</li>
  <li>预训练：RegNet+FPN 深度编码器，TartanAir 合成深度 + 噪声模型</li>
</ul>

<h2 id="8-my-takeaways个人总结">8. My Takeaways（个人总结）</h2>
<p>1) 在“隐式建图”问题上，单纯换 RNN 结构难以解决空间对齐问题，但引入显式空间变换项能显著改善。
2) 注意力机制不仅压缩信息量，更重要的是让状态驱动视觉选择，提升记忆效率。
3) DML 与 TC-Dropout 对序列学习非常关键，避免记忆学习早期崩坏。
4) 若我做长程导航/探索任务，可优先尝试“注意力 + SRU + 稀疏奖励 + DML”组合。</p>

<h2 id="references">References</h2>
<ul>
  <li>[1] Fan Yang et al. <em>Spatially-Enhanced Recurrent Memory for Long-Range Mapless Navigation via End-to-End Reinforcement Learning</em>. arXiv:2506.05997v2, 2025.</li>
</ul>]]></content><author><name>Jerry Zhu</name></author><category term="paper" /><category term="navigation" /><category term="reinforcement-learning" /><category term="rnn" /><category term="attention" /><category term="sim2real" /><summary type="html"><![CDATA[Title + 摘要 本文研究长程无地图导航的核心难题：在仅有前向深度观测的条件下，如何在动态视角变化中形成稳定的空间记忆，从而实现规划与避障。作者指出传统 RNN（LSTM/GRU）擅长时间记忆却不擅长空间配准，导致对历史观测的空间对齐能力不足，难以形成长期空间表征。为此提出 Spatially-Enhanced Recurrent Unit (SRU)，在标准门控循环单元中引入空间变换项，使其隐式学习视角变化下的空间对齐。基于 SRU，作者构建双层空间注意力 + SRU 的端到端 RL 架构，并结合深度编码器预训练、深度噪声模型、DML 与时序一致 Dropout 等训练策略，实现更稳定的长程导航训练。实验表明 SRU 在多种环境下成功率显著提升（整体约 +23.5%，对 EMHP 与堆叠历史观测基线提升约 29.6% 与 105.0%），并在真实场景中实现零样本 sim-to-real 部署。本文对“隐式记忆能否替代显式建图”的问题给出强有力的工程化答案。]]></summary></entry><entry><title type="html">Project Retrospective: Grasping in Clutter</title><link href="https://jerryzyc.github.io/work/2024/11/06/work-grasping-retrospective.html" rel="alternate" type="text/html" title="Project Retrospective: Grasping in Clutter" /><published>2024-11-06T00:00:00+08:00</published><updated>2024-11-06T00:00:00+08:00</updated><id>https://jerryzyc.github.io/work/2024/11/06/work-grasping-retrospective</id><content type="html" xml:base="https://jerryzyc.github.io/work/2024/11/06/work-grasping-retrospective.html"><![CDATA[<h2 id="background">Background</h2>
<p>Bin picking in a cluttered scene with partial observability.</p>

<h2 id="goals">Goals</h2>
<ul>
  <li>Achieve 80 percent success rate on 20 objects.</li>
  <li>End-to-end pipeline with perception and grasping.</li>
</ul>

<h2 id="approach">Approach</h2>
<ul>
  <li>Train grasp proposals in simulation.</li>
  <li>Fine-tune on real data with domain randomization.</li>
  <li>Integrate with a motion planner and force feedback.</li>
</ul>

<h2 id="results">Results</h2>
<ul>
  <li>Reached 76 percent in the lab with stable runtime.</li>
</ul>

<h2 id="lessons-learned">Lessons Learned</h2>
<ul>
  <li>Dataset bias dominated early failures.</li>
  <li>Calibration drift required weekly checks.</li>
</ul>

<h2 id="next-actions">Next Actions</h2>
<ul>
  <li>Expand object set and improve camera poses.</li>
</ul>]]></content><author><name>Jerry Zhu</name></author><category term="work" /><category term="project" /><category term="manipulation" /><category term="sim2real" /><summary type="html"><![CDATA[Background Bin picking in a cluttered scene with partial observability.]]></summary></entry><entry><title type="html">Robot Learning Skill Tree and Roadmap</title><link href="https://jerryzyc.github.io/skills/2024/11/05/skills-robot-learning-roadmap.html" rel="alternate" type="text/html" title="Robot Learning Skill Tree and Roadmap" /><published>2024-11-05T00:00:00+08:00</published><updated>2024-11-05T00:00:00+08:00</updated><id>https://jerryzyc.github.io/skills/2024/11/05/skills-robot-learning-roadmap</id><content type="html" xml:base="https://jerryzyc.github.io/skills/2024/11/05/skills-robot-learning-roadmap.html"><![CDATA[<h2 id="skill-tree">Skill Tree</h2>
<ul>
  <li>Robot Learning: policy gradients, offline RL, model-based RL</li>
  <li>Motion Planning: sampling-based, optimization-based, constraints</li>
  <li>Control: PID, LQR, MPC</li>
  <li>ROS2: nodes, TF, launch, tooling</li>
  <li>Sim Platforms: Isaac Sim/Lab, Mujoco, Gazebo</li>
  <li>MLOps: data/versioning, training pipelines, eval dashboards</li>
</ul>

<h2 id="suggested-learning-path">Suggested Learning Path</h2>
<ol>
  <li>Control fundamentals and dynamics basics.</li>
  <li>Motion planning algorithms and constraints.</li>
  <li>Deep RL foundations and PPO/SAC practice.</li>
  <li>Sim2real and domain randomization.</li>
  <li>System integration in ROS2.</li>
</ol>]]></content><author><name>Jerry Zhu</name></author><category term="skills" /><category term="skills" /><category term="roadmap" /><category term="robot-learning" /><summary type="html"><![CDATA[Skill Tree Robot Learning: policy gradients, offline RL, model-based RL Motion Planning: sampling-based, optimization-based, constraints Control: PID, LQR, MPC ROS2: nodes, TF, launch, tooling Sim Platforms: Isaac Sim/Lab, Mujoco, Gazebo MLOps: data/versioning, training pipelines, eval dashboards]]></summary></entry><entry><title type="html">Domain Randomization for Sim2Real</title><link href="https://jerryzyc.github.io/learning/2024/11/02/learning-domain-randomization.html" rel="alternate" type="text/html" title="Domain Randomization for Sim2Real" /><published>2024-11-02T00:00:00+08:00</published><updated>2024-11-02T00:00:00+08:00</updated><id>https://jerryzyc.github.io/learning/2024/11/02/learning-domain-randomization</id><content type="html" xml:base="https://jerryzyc.github.io/learning/2024/11/02/learning-domain-randomization.html"><![CDATA[<h2 id="key-concepts">Key Concepts</h2>
<ul>
  <li>Randomize visual, dynamics, and sensor parameters.</li>
  <li>Use curriculum to expand ranges gradually.</li>
</ul>

<h2 id="common-pitfalls">Common Pitfalls</h2>
<ul>
  <li>Randomization too wide makes policy underfit.</li>
  <li>Mismatch between randomized assets and target robot.</li>
</ul>

<h2 id="practical-checklist">Practical Checklist</h2>
<ul>
  <li>Start with camera and lighting randomization.</li>
  <li>Add dynamics later (mass, friction, delay).</li>
  <li>Track real-world success rate per setting.</li>
</ul>

<h2 id="math-note">Math Note</h2>
<p>Reward shaping often uses:
\(r_t = \alpha r_{task} + \beta r_{stability}\)</p>]]></content><author><name>Jerry Zhu</name></author><category term="learning" /><category term="sim2real" /><category term="domain-randomization" /><category term="perception" /><summary type="html"><![CDATA[Key Concepts Randomize visual, dynamics, and sensor parameters. Use curriculum to expand ranges gradually.]]></summary></entry><entry><title type="html">PPO Tricks for Stable Training</title><link href="https://jerryzyc.github.io/learning/2024/11/01/learning-ppo-tricks.html" rel="alternate" type="text/html" title="PPO Tricks for Stable Training" /><published>2024-11-01T00:00:00+08:00</published><updated>2024-11-01T00:00:00+08:00</updated><id>https://jerryzyc.github.io/learning/2024/11/01/learning-ppo-tricks</id><content type="html" xml:base="https://jerryzyc.github.io/learning/2024/11/01/learning-ppo-tricks.html"><![CDATA[<h2 id="key-concepts">Key Concepts</h2>
<ul>
  <li>Clip ratio and value loss balance.</li>
  <li>Advantage normalization and reward scaling.</li>
  <li>Early stopping based on KL divergence.</li>
</ul>

<h2 id="common-pitfalls">Common Pitfalls</h2>
<ul>
  <li>Too large learning rate causes policy collapse.</li>
  <li>Value function overfits when minibatches are too small.</li>
</ul>

<h2 id="practical-checklist">Practical Checklist</h2>
<ul>
  <li>Normalize advantages per batch.</li>
  <li>Track KL and stop epochs if it spikes.</li>
  <li>Use entropy bonus to avoid premature convergence.</li>
</ul>

<h2 id="quick-reference">Quick Reference</h2>
<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1"># Pseudocode for PPO update loop
</span><span class="k">for</span> <span class="n">epoch</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">k_epochs</span><span class="p">):</span>
    <span class="n">logp_new</span> <span class="o">=</span> <span class="n">policy</span><span class="p">(</span><span class="n">obs</span><span class="p">,</span> <span class="n">act</span><span class="p">)</span>
    <span class="n">ratio</span> <span class="o">=</span> <span class="n">exp</span><span class="p">(</span><span class="n">logp_new</span> <span class="o">-</span> <span class="n">logp_old</span><span class="p">)</span>
    <span class="n">loss_clip</span> <span class="o">=</span> <span class="o">-</span><span class="nb">min</span><span class="p">(</span><span class="n">ratio</span> <span class="o">*</span> <span class="n">adv</span><span class="p">,</span> <span class="n">clip</span><span class="p">(</span><span class="n">ratio</span><span class="p">,</span> <span class="mi">1</span><span class="o">-</span><span class="n">eps</span><span class="p">,</span> <span class="mi">1</span><span class="o">+</span><span class="n">eps</span><span class="p">)</span> <span class="o">*</span> <span class="n">adv</span><span class="p">)</span>
    <span class="n">loss</span> <span class="o">=</span> <span class="n">loss_clip</span> <span class="o">+</span> <span class="n">vf_coef</span> <span class="o">*</span> <span class="n">value_loss</span> <span class="o">-</span> <span class="n">ent_coef</span> <span class="o">*</span> <span class="n">entropy</span>
</code></pre></div></div>]]></content><author><name>Jerry Zhu</name></author><category term="learning" /><category term="rl" /><category term="ppo" /><category term="policy" /><category term="stability" /><summary type="html"><![CDATA[Key Concepts Clip ratio and value loss balance. Advantage normalization and reward scaling. Early stopping based on KL divergence.]]></summary></entry></feed>