Appearance
Labs → 实验
⚠️ 本页已合并到 实验目录。
/labs/不再是顶级导航;如果你从旧链接进来,请前往/examples/查看完整实验列表。
实验目录现在按"独立可运行的命令 + 预期输出"组织,每个实验对应正文的一章。如果你想看每章实验与 llm_core/ 模块 / 测试文件的对应表,原 Labs 总览中的映射仍有效:
| 章节 | 实验 | 模块 | 测试 |
|---|---|---|---|
| 第3章 | autograd | python/llm_core/autograd.py | test_autograd.py |
| 第4章 | Bigram/MLP | bigram.py, mlp_lm.py | test_bigram_mlp.py |
| 第5章 | BPE | bpe.py | test_bpe.py |
| 第6–7章 | Tensor/Attention/GPT | tensor_grad.py, attention.py, gpt.py | test_attention_gpt.py |
| 第8章 | TinyGPT | python/llm_train/ | test_trainable_tinygpt.py |
| 第9章 | RoPE + KV Cache | kv_cache.py, swiglu.py, rmsnorm.py, paged_kv.py | test_w07_algorithms.py |
| 第10章 | SFT/LoRA | align.py | test_align_kv.py |
| 第11章 | RAG/ACL | python/agent_core/rag.py, embedding.py | test_rag_acl.py |
| 第13章 | Agent/MCP | python/agent_core/engine.py, tools.py | test_tool_policy.py, test_mcp_adapter.py |
| 第18章 | Eval/安全 | python/agent_core/eval.py | test_eval_spec.py |
| 第19章 | Capstone | 集成 | pnpm verify + 人工答辩 |
跑测试的命令:
bash
export PYTHONPATH="$PWD/python"
pnpm test:labs
python -m pytest python/tests -q --tb=short完整文档见 实验目录。