Appearance
Level4 精读总览
Abstract
这一层是代码逐行精读,拆成两个子文件。每个子文件自包含,有自己的完整 toy 数值追踪。
本文件是索引,说明各子文件的覆盖范围和阅读顺序。
子文件列表
| 文件 | 覆盖代码 | 输入 → 输出 | 核心操作 |
|---|---|---|---|
| 04A-PatchEmbedding精读 | Embed.py:PatchEmbedding | (2,3,9) → (6,4,8) | padding / unfold / reshape / Linear |
| 04B-Encoder精读 | Transformer_EncDec.py:Encoder/EncoderLayer + SelfAttention_Family.py:AttentionLayer/FullAttention + PatchTST.py:FlattenHead | (6,4,8) → (2,7,3) | QKV projection / einsum attention / Conv1d FFN / FlattenHead |
建议阅读顺序
04A(PatchEmbedding)→ 04B(Encoder + FlattenHead)04A 输出的 (6, 4, 8) 正好是 04B 的输入,顺序读完后 toy tensor 贯穿始终。