Files
maths-cs-ai-compendium-zh/images/ssm_dual_view.svg
T
flykhan 2536c937e3 feat: 完整中文翻译 maths-cs-ai-compendium(数学·计算机科学·AI 知识大全)
翻译自英文原版 maths-cs-ai-compendium,共 20 章全部完成。

第01章 向量 | 第02章 矩阵 | 第03章 微积分
第04章 统计学 | 第05章 概率论 | 第06章 机器学习
第07章 计算语言学 | 第08章 计算机视觉 | 第09章 音频与语音
第10章 多模态学习 | 第11章 自主系统 | 第12章 图神经网络
第13章 计算与操作系统 | 第14章 数据结构与算法
第15章 生产级软件工程 | 第16章 SIMD与GPU编程
第17章 AI推理 | 第18章 ML系统设计
第19章 应用人工智能 | 第20章 前沿人工智能

翻译说明:
- 所有数学公式 $...$ / $$...$$、代码块、图片引用完整保留
- mkdocs.yml 配置中文导航 + language: zh
- README.md 已翻译为中文(兼 docs/index.md)
- docs/ 目录包含指向各章文件的 symlink
- 约 29,000 行中文内容,排除 .cache/ 构建缓存
2026-05-03 10:23:20 +08:00

92 lines
6.3 KiB
XML

<svg width="720" height="290" xmlns="http://www.w3.org/2000/svg">
<defs>
<marker id="ssm-arrow" markerWidth="7" markerHeight="5" refX="7" refY="2.5" orient="auto">
<polygon points="0 0, 7 2.5, 0 5" fill="#555"/>
</marker>
</defs>
<text x="360" y="22" fill="#333" font-size="14" font-weight="bold" text-anchor="middle">State Space Model: Dual View</text>
<!-- Recurrence view (top left) -->
<rect x="20" y="42" width="330" height="110" rx="10" fill="#3498db" opacity="0.05" stroke="#3498db" stroke-width="1.5"/>
<text x="185" y="62" fill="#3498db" font-size="11" font-weight="bold" text-anchor="middle">Recurrence View (Inference: O(1) per step)</text>
<!-- State boxes -->
<rect x="40" y="78" width="40" height="28" rx="4" fill="#3498db" opacity="0.15" stroke="#3498db" stroke-width="1.5"/>
<text x="60" y="96" fill="#3498db" font-size="9" text-anchor="middle">x₁</text>
<line x1="80" y1="92" x2="110" y2="92" stroke="#3498db" stroke-width="1.5" marker-end="url(#ssm-arrow)"/>
<text x="95" y="85" fill="#3498db" font-size="8" text-anchor="middle">Ā</text>
<rect x="115" y="78" width="40" height="28" rx="4" fill="#3498db" opacity="0.15" stroke="#3498db" stroke-width="1.5"/>
<text x="135" y="96" fill="#3498db" font-size="9" text-anchor="middle">x₂</text>
<line x1="155" y1="92" x2="185" y2="92" stroke="#3498db" stroke-width="1.5" marker-end="url(#ssm-arrow)"/>
<text x="170" y="85" fill="#3498db" font-size="8" text-anchor="middle">Ā</text>
<rect x="190" y="78" width="40" height="28" rx="4" fill="#3498db" opacity="0.15" stroke="#3498db" stroke-width="1.5"/>
<text x="210" y="96" fill="#3498db" font-size="9" text-anchor="middle">x₃</text>
<line x1="230" y1="92" x2="260" y2="92" stroke="#3498db" stroke-width="1.5" marker-end="url(#ssm-arrow)"/>
<text x="245" y="85" fill="#3498db" font-size="8" text-anchor="middle">Ā</text>
<rect x="265" y="78" width="40" height="28" rx="4" fill="#3498db" opacity="0.15" stroke="#3498db" stroke-width="1.5"/>
<text x="285" y="96" fill="#3498db" font-size="9" text-anchor="middle">x₄</text>
<!-- Input arrows up -->
<line x1="60" y1="125" x2="60" y2="108" stroke="#f39c12" stroke-width="1" marker-end="url(#ssm-arrow)"/>
<text x="60" y="137" fill="#f39c12" font-size="8" text-anchor="middle">u₁</text>
<line x1="135" y1="125" x2="135" y2="108" stroke="#f39c12" stroke-width="1" marker-end="url(#ssm-arrow)"/>
<text x="135" y="137" fill="#f39c12" font-size="8" text-anchor="middle">u₂</text>
<line x1="210" y1="125" x2="210" y2="108" stroke="#f39c12" stroke-width="1" marker-end="url(#ssm-arrow)"/>
<text x="210" y="137" fill="#f39c12" font-size="8" text-anchor="middle">u₃</text>
<line x1="285" y1="125" x2="285" y2="108" stroke="#f39c12" stroke-width="1" marker-end="url(#ssm-arrow)"/>
<text x="285" y="137" fill="#f39c12" font-size="8" text-anchor="middle">u₄</text>
<!-- Recurrence equation -->
<text x="185" y="155" fill="#555" font-size="9" text-anchor="middle" font-style="italic">xₖ = Āxₖ₋₁ + B̄uₖ , yₖ = Cxₖ</text>
<!-- Convolution view (top right) -->
<rect x="370" y="42" width="335" height="110" rx="10" fill="#27ae60" opacity="0.05" stroke="#27ae60" stroke-width="1.5"/>
<text x="537" y="62" fill="#27ae60" font-size="11" font-weight="bold" text-anchor="middle">Convolution View (Training: O(n log n))</text>
<!-- Kernel -->
<rect x="390" y="78" width="40" height="28" rx="4" fill="#27ae60" opacity="0.15" stroke="#27ae60" stroke-width="1.5"/>
<text x="410" y="96" fill="#27ae60" font-size="8" text-anchor="middle">CB̄</text>
<rect x="438" y="78" width="40" height="28" rx="4" fill="#27ae60" opacity="0.15" stroke="#27ae60" stroke-width="1.5"/>
<text x="458" y="96" fill="#27ae60" font-size="7" text-anchor="middle">CĀB̄</text>
<rect x="486" y="78" width="42" height="28" rx="4" fill="#27ae60" opacity="0.15" stroke="#27ae60" stroke-width="1.5"/>
<text x="507" y="96" fill="#27ae60" font-size="7" text-anchor="middle">C²B̄</text>
<text x="543" y="96" fill="#27ae60" font-size="14" text-anchor="middle"></text>
<rect x="558" y="78" width="52" height="28" rx="4" fill="#27ae60" opacity="0.15" stroke="#27ae60" stroke-width="1.5"/>
<text x="584" y="96" fill="#27ae60" font-size="7" text-anchor="middle">CĀⁿ⁻¹B̄</text>
<!-- Convolution symbol -->
<text x="537" y="125" fill="#555" font-size="11" text-anchor="middle"></text>
<text x="537" y="140" fill="#f39c12" font-size="9" text-anchor="middle">[u₁, u₂, u₃, … , uₙ]</text>
<!-- Convolution equation -->
<text x="537" y="155" fill="#555" font-size="9" text-anchor="middle" font-style="italic">y = K̄ * u (computed via FFT)</text>
<!-- Bottom: Mamba selective SSM -->
<rect x="60" y="170" width="600" height="55" rx="10" fill="#9b59b6" opacity="0.05" stroke="#9b59b6" stroke-width="1.5"/>
<text x="360" y="190" fill="#9b59b6" font-size="12" font-weight="bold" text-anchor="middle">Mamba: Selective State Spaces</text>
<text x="360" y="207" fill="#555" font-size="10" text-anchor="middle">B, C, Δ become input-dependent → content-aware gating (like attention, but O(n))</text>
<text x="360" y="220" fill="#555" font-size="9" text-anchor="middle">Breaks convolution view → uses hardware-aware parallel scan instead of FFT</text>
<!-- Comparison boxes -->
<rect x="60" y="238" width="190" height="42" rx="8" fill="#e74c3c" opacity="0.06" stroke="#e74c3c" stroke-width="1"/>
<text x="155" y="255" fill="#e74c3c" font-size="9" text-anchor="middle" font-weight="bold">Transformer: O(n²) attn, O(n·d) KV cache</text>
<text x="155" y="270" fill="#666" font-size="8" text-anchor="middle">Precise content lookup</text>
<rect x="265" y="238" width="190" height="42" rx="8" fill="#3498db" opacity="0.06" stroke="#3498db" stroke-width="1"/>
<text x="360" y="255" fill="#3498db" font-size="9" text-anchor="middle" font-weight="bold">SSM/Mamba: O(n) scan, O(N) state</text>
<text x="360" y="270" fill="#666" font-size="8" text-anchor="middle">Smooth long-range propagation</text>
<rect x="470" y="238" width="190" height="42" rx="8" fill="#27ae60" opacity="0.06" stroke="#27ae60" stroke-width="1"/>
<text x="565" y="255" fill="#27ae60" font-size="9" text-anchor="middle" font-weight="bold">Hybrid (Jamba/Zamba)</text>
<text x="565" y="270" fill="#666" font-size="8" text-anchor="middle">Best of both: SSM + sparse attention</text>
</svg>