mini_lm/README.md

24 lines
517 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

从零训练一个迷你语言模型
第 1 天:字符级 RNNGRU
环境要求
- Python 3.10+
- PyTorchApple Silicon 支持 MPS
安装与准备
- python -m venv .venv
- source .venv/bin/activate
- pip install torch
运行
- python day1_char_rnn.py
你应该看到
- 每 100 步输出一次 loss
- 每 200 步输出一次采样文本
说明
- 这是一个极小的数据集和模型,只为验证完整训练流程。
- 下一步我们会把硬编码文本替换为文件,并加入评估指标。