2026-03-18 09:07:01 +00:00
|
|
|
# RL-Study
|
2026-02-27 18:19:54 +08:00
|
|
|
|
2026-03-18 09:07:01 +00:00
|
|
|
强化学习算法实现与学习笔记,基于赵世钰老师《Mathematical Foundations of Reinforcement Learning》。
|
2026-02-27 18:32:59 +08:00
|
|
|
|
2026-03-18 09:07:01 +00:00
|
|
|
## 项目结构
|
2026-02-27 18:21:24 +08:00
|
|
|
|
2026-03-18 09:07:01 +00:00
|
|
|
```
|
|
|
|
|
RL-Study/
|
|
|
|
|
├── Lecture slides/ # 课程幻灯片
|
|
|
|
|
│ ├── slidesForMyLectureVideos/ # 配套视频课件
|
|
|
|
|
│ └── slidesContinuouslyUpdated/ # 持续更新的课件
|
|
|
|
|
├── Notebooks/ # Jupyter 学习笔记
|
|
|
|
|
│ ├── C1.ipynb ~ C10.ipynb # 各章节推导与实验
|
|
|
|
|
│ ├── SAC.ipynb # SAC (Soft Actor-Critic) 算法
|
|
|
|
|
│ └── *_training_results.png # 训练结果可视化
|
|
|
|
|
├── RawBook/ # 原书资源
|
|
|
|
|
└── RL_Algothrithms/ # 核心算法实现
|
|
|
|
|
├── agents/ # 智能体实现
|
|
|
|
|
│ ├── a2c.py # A2C (Advantage Actor-Critic)
|
|
|
|
|
│ └── qac.py # QAC (Soft Actor-Critic / Q-Value Actor-Critic)
|
|
|
|
|
├── networks.py # 神经网络定义
|
|
|
|
|
├── utils.py # 工具函数
|
|
|
|
|
└── main.py # 训练入口
|
|
|
|
|
```
|
2026-02-27 18:21:24 +08:00
|
|
|
|
2026-03-18 09:07:01 +00:00
|
|
|
## 已实现算法
|
|
|
|
|
|
|
|
|
|
| 算法 | 文件 | 说明 |
|
|
|
|
|
|------|------|------|
|
|
|
|
|
| A2C | [a2c.py](RL_Algothrithms/agents/a2c.py) | Advantage Actor-Critic,同步版本 |
|
|
|
|
|
| QAC | [qac.py](RL_Algothrithms/agents/qac.py) | Q-Value Actor-Critic,支持 GPU |
|
|
|
|
|
|
|
|
|
|
## 环境配置
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
pip install torch numpy matplotlib gymnasium
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## 快速开始
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
cd RL_Algothrithms
|
|
|
|
|
python main.py --agent a2c # 训练 A2C
|
|
|
|
|
python main.py --agent qac # 训练 QAC
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## 关于原书
|
2026-02-27 18:21:24 +08:00
|
|
|
|
|
|
|
|
- **书名**: Mathematical Foundations of Reinforcement Learning
|
|
|
|
|
- **作者**: Shiyu Zhao (Westlake University)
|
2026-03-18 09:07:01 +00:00
|
|
|
- **GitHub**: [MathFoundationRL/Book-Mathematical-Foundation-of-Reinforcement-Learning](https://github.com/MathFoundationRL/Book-Mathematical-Foundation-of-Reinforcement-Learning)
|
|
|
|
|
- **B站**: [赵世钰老师频道](https://space.bilibili.com/2044042934)
|
|
|
|
|
- **YouTube**: [课程列表](https://youtube.com/playlist?list=PLEhdbSEZZbDaFWPX4gehhwB9vJZJ1DNm8)
|
2026-02-27 18:21:24 +08:00
|
|
|
|
2026-03-18 09:07:01 +00:00
|
|
|
## License
|
2026-02-27 18:21:24 +08:00
|
|
|
|
2026-03-18 09:07:01 +00:00
|
|
|
MIT License(代码部分)
|