From d696d99f3a48f004163b459429c51e0e27400a3c Mon Sep 17 00:00:00 2001 From: AmadeusGB <1069830494@qq.com> Date: Tue, 11 Mar 2025 16:48:15 -0700 Subject: [PATCH 1/2] update cn version --- units/cn/_toctree.yml | 260 ++++ units/cn/communication/certification.mdx | 29 + units/cn/communication/conclusion.mdx | 24 + units/cn/live1/live1.mdx | 9 + units/cn/unit0/discord101.mdx | 37 + units/cn/unit0/introduction.mdx | 136 ++ units/cn/unit0/setup.mdx | 31 + units/cn/unit1/additional-readings.mdx | 14 + units/cn/unit1/conclusion.mdx | 21 + units/cn/unit1/deep-rl.mdx | 20 + units/cn/unit1/exp-exp-tradeoff.mdx | 36 + units/cn/unit1/glossary.mdx | 70 + units/cn/unit1/hands-on.mdx | 702 ++++++++++ units/cn/unit1/introduction.mdx | 27 + units/cn/unit1/quiz.mdx | 168 +++ units/cn/unit1/rl-framework.mdx | 141 ++ units/cn/unit1/summary.mdx | 19 + units/cn/unit1/tasks.mdx | 26 + units/cn/unit1/two-methods.mdx | 90 ++ units/cn/unit1/what-is-rl.mdx | 40 + units/cn/unit2/additional-readings.mdx | 15 + units/cn/unit2/bellman-equation.mdx | 63 + units/cn/unit2/conclusion.mdx | 20 + units/cn/unit2/glossary.mdx | 47 + units/cn/unit2/hands-on.mdx | 1148 +++++++++++++++++ units/cn/unit2/introduction.mdx | 26 + units/cn/unit2/mc-vs-td.mdx | 135 ++ units/cn/unit2/mid-way-quiz.mdx | 106 ++ units/cn/unit2/mid-way-recap.mdx | 17 + units/cn/unit2/q-learning-example.mdx | 83 ++ units/cn/unit2/q-learning-recap.mdx | 24 + units/cn/unit2/q-learning.mdx | 160 +++ units/cn/unit2/quiz2.mdx | 96 ++ .../unit2/two-types-value-based-methods.mdx | 85 ++ units/cn/unit2/what-is-rl.mdx | 25 + units/cn/unit3/additional-readings.mdx | 9 + units/cn/unit3/conclusion.mdx | 17 + units/cn/unit3/deep-q-algorithm.mdx | 105 ++ units/cn/unit3/deep-q-network.mdx | 41 + units/cn/unit3/from-q-to-dqn.mdx | 34 + units/cn/unit3/glossary.mdx | 37 + units/cn/unit3/hands-on.mdx | 341 +++++ units/cn/unit3/introduction.mdx | 19 + units/cn/unit3/quiz.mdx | 104 ++ units/cn/unit4/additional-readings.mdx | 20 + units/cn/unit4/advantages-disadvantages.mdx | 74 ++ units/cn/unit4/conclusion.mdx | 15 + units/cn/unit4/glossary.mdx | 25 + units/cn/unit4/hands-on.mdx | 1019 +++++++++++++++ units/cn/unit4/introduction.mdx | 24 + units/cn/unit4/pg-theorem.mdx | 86 ++ units/cn/unit4/policy-gradient.mdx | 122 ++ units/cn/unit4/quiz.mdx | 82 ++ .../unit4/what-are-policy-based-methods.mdx | 42 + units/cn/unit5/bonus.mdx | 19 + units/cn/unit5/conclusion.mdx | 22 + units/cn/unit5/curiosity.mdx | 50 + units/cn/unit5/hands-on.mdx | 416 ++++++ units/cn/unit5/how-mlagents-works.mdx | 68 + units/cn/unit5/introduction.mdx | 31 + units/cn/unit5/pyramids.mdx | 39 + units/cn/unit5/quiz.mdx | 132 ++ units/cn/unit5/snowball-target.mdx | 57 + units/cn/unit6/additional-readings.mdx | 17 + units/cn/unit6/advantage-actor-critic.mdx | 70 + units/cn/unit6/conclusion.mdx | 11 + units/cn/unit6/hands-on.mdx | 396 ++++++ units/cn/unit6/introduction.mdx | 22 + units/cn/unit6/quiz.mdx | 123 ++ units/cn/unit6/variance-problem.mdx | 31 + units/cn/unit7/additional-readings.mdx | 17 + units/cn/unit7/conclusion.mdx | 11 + units/cn/unit7/hands-on.mdx | 322 +++++ units/cn/unit7/introduction-to-marl.mdx | 55 + units/cn/unit7/introduction.mdx | 36 + units/cn/unit7/multi-agent-setting.mdx | 57 + units/cn/unit7/quiz.mdx | 139 ++ units/cn/unit7/self-play.mdx | 134 ++ units/cn/unit8/additional-readings.mdx | 21 + .../cn/unit8/clipped-surrogate-objective.mdx | 69 + units/cn/unit8/conclusion-sf.mdx | 13 + units/cn/unit8/conclusion.mdx | 9 + units/cn/unit8/hands-on-cleanrl.mdx | 1078 ++++++++++++++++ units/cn/unit8/hands-on-sf.mdx | 430 ++++++ units/cn/unit8/introduction-sf.mdx | 13 + units/cn/unit8/introduction.mdx | 23 + units/cn/unit8/intuition-behind-ppo.mdx | 16 + units/cn/unit8/visualize.mdx | 68 + units/cn/unitbonus1/conclusion.mdx | 12 + units/cn/unitbonus1/how-huggy-works.mdx | 66 + units/cn/unitbonus1/introduction.mdx | 7 + units/cn/unitbonus1/play.mdx | 18 + units/cn/unitbonus1/train.mdx | 348 +++++ units/cn/unitbonus2/hands-on.mdx | 16 + units/cn/unitbonus2/introduction.mdx | 7 + units/cn/unitbonus2/optuna.mdx | 15 + units/cn/unitbonus3/curriculum-learning.mdx | 53 + units/cn/unitbonus3/decision-transformers.mdx | 31 + units/cn/unitbonus3/envs-to-try.mdx | 88 ++ units/cn/unitbonus3/generalisation.mdx | 12 + units/cn/unitbonus3/godotrl.mdx | 257 ++++ units/cn/unitbonus3/introduction.mdx | 11 + units/cn/unitbonus3/language-models.mdx | 45 + units/cn/unitbonus3/learning-agents.mdx | 37 + units/cn/unitbonus3/model-based.mdx | 32 + units/cn/unitbonus3/offline-online.mdx | 37 + units/cn/unitbonus3/rl-documentation.mdx | 51 + units/cn/unitbonus3/rlhf.mdx | 50 + units/cn/unitbonus3/student-works.mdx | 68 + units/cn/unitbonus5/conclusion.mdx | 5 + .../unitbonus5/customize-the-environment.mdx | 27 + units/cn/unitbonus5/getting-started.mdx | 266 ++++ units/cn/unitbonus5/introduction.mdx | 23 + units/cn/unitbonus5/the-environment.mdx | 9 + units/cn/unitbonus5/train-our-robot.mdx | 53 + 115 files changed, 11825 insertions(+) create mode 100644 units/cn/_toctree.yml create mode 100644 units/cn/communication/certification.mdx create mode 100644 units/cn/communication/conclusion.mdx create mode 100644 units/cn/live1/live1.mdx create mode 100644 units/cn/unit0/discord101.mdx create mode 100644 units/cn/unit0/introduction.mdx create mode 100644 units/cn/unit0/setup.mdx create mode 100644 units/cn/unit1/additional-readings.mdx create mode 100644 units/cn/unit1/conclusion.mdx create mode 100644 units/cn/unit1/deep-rl.mdx create mode 100644 units/cn/unit1/exp-exp-tradeoff.mdx create mode 100644 units/cn/unit1/glossary.mdx create mode 100644 units/cn/unit1/hands-on.mdx create mode 100644 units/cn/unit1/introduction.mdx create mode 100644 units/cn/unit1/quiz.mdx create mode 100644 units/cn/unit1/rl-framework.mdx create mode 100644 units/cn/unit1/summary.mdx create mode 100644 units/cn/unit1/tasks.mdx create mode 100644 units/cn/unit1/two-methods.mdx create mode 100644 units/cn/unit1/what-is-rl.mdx create mode 100644 units/cn/unit2/additional-readings.mdx create mode 100644 units/cn/unit2/bellman-equation.mdx create mode 100644 units/cn/unit2/conclusion.mdx create mode 100644 units/cn/unit2/glossary.mdx create mode 100644 units/cn/unit2/hands-on.mdx create mode 100644 units/cn/unit2/introduction.mdx create mode 100644 units/cn/unit2/mc-vs-td.mdx create mode 100644 units/cn/unit2/mid-way-quiz.mdx create mode 100644 units/cn/unit2/mid-way-recap.mdx create mode 100644 units/cn/unit2/q-learning-example.mdx create mode 100644 units/cn/unit2/q-learning-recap.mdx create mode 100644 units/cn/unit2/q-learning.mdx create mode 100644 units/cn/unit2/quiz2.mdx create mode 100644 units/cn/unit2/two-types-value-based-methods.mdx create mode 100644 units/cn/unit2/what-is-rl.mdx create mode 100644 units/cn/unit3/additional-readings.mdx create mode 100644 units/cn/unit3/conclusion.mdx create mode 100644 units/cn/unit3/deep-q-algorithm.mdx create mode 100644 units/cn/unit3/deep-q-network.mdx create mode 100644 units/cn/unit3/from-q-to-dqn.mdx create mode 100644 units/cn/unit3/glossary.mdx create mode 100644 units/cn/unit3/hands-on.mdx create mode 100644 units/cn/unit3/introduction.mdx create mode 100644 units/cn/unit3/quiz.mdx create mode 100644 units/cn/unit4/additional-readings.mdx create mode 100644 units/cn/unit4/advantages-disadvantages.mdx create mode 100644 units/cn/unit4/conclusion.mdx create mode 100644 units/cn/unit4/glossary.mdx create mode 100644 units/cn/unit4/hands-on.mdx create mode 100644 units/cn/unit4/introduction.mdx create mode 100644 units/cn/unit4/pg-theorem.mdx create mode 100644 units/cn/unit4/policy-gradient.mdx create mode 100644 units/cn/unit4/quiz.mdx create mode 100644 units/cn/unit4/what-are-policy-based-methods.mdx create mode 100644 units/cn/unit5/bonus.mdx create mode 100644 units/cn/unit5/conclusion.mdx create mode 100644 units/cn/unit5/curiosity.mdx create mode 100644 units/cn/unit5/hands-on.mdx create mode 100644 units/cn/unit5/how-mlagents-works.mdx create mode 100644 units/cn/unit5/introduction.mdx create mode 100644 units/cn/unit5/pyramids.mdx create mode 100644 units/cn/unit5/quiz.mdx create mode 100644 units/cn/unit5/snowball-target.mdx create mode 100644 units/cn/unit6/additional-readings.mdx create mode 100644 units/cn/unit6/advantage-actor-critic.mdx create mode 100644 units/cn/unit6/conclusion.mdx create mode 100644 units/cn/unit6/hands-on.mdx create mode 100644 units/cn/unit6/introduction.mdx create mode 100644 units/cn/unit6/quiz.mdx create mode 100644 units/cn/unit6/variance-problem.mdx create mode 100644 units/cn/unit7/additional-readings.mdx create mode 100644 units/cn/unit7/conclusion.mdx create mode 100644 units/cn/unit7/hands-on.mdx create mode 100644 units/cn/unit7/introduction-to-marl.mdx create mode 100644 units/cn/unit7/introduction.mdx create mode 100644 units/cn/unit7/multi-agent-setting.mdx create mode 100644 units/cn/unit7/quiz.mdx create mode 100644 units/cn/unit7/self-play.mdx create mode 100644 units/cn/unit8/additional-readings.mdx create mode 100644 units/cn/unit8/clipped-surrogate-objective.mdx create mode 100644 units/cn/unit8/conclusion-sf.mdx create mode 100644 units/cn/unit8/conclusion.mdx create mode 100644 units/cn/unit8/hands-on-cleanrl.mdx create mode 100644 units/cn/unit8/hands-on-sf.mdx create mode 100644 units/cn/unit8/introduction-sf.mdx create mode 100644 units/cn/unit8/introduction.mdx create mode 100644 units/cn/unit8/intuition-behind-ppo.mdx create mode 100644 units/cn/unit8/visualize.mdx create mode 100644 units/cn/unitbonus1/conclusion.mdx create mode 100644 units/cn/unitbonus1/how-huggy-works.mdx create mode 100644 units/cn/unitbonus1/introduction.mdx create mode 100644 units/cn/unitbonus1/play.mdx create mode 100644 units/cn/unitbonus1/train.mdx create mode 100644 units/cn/unitbonus2/hands-on.mdx create mode 100644 units/cn/unitbonus2/introduction.mdx create mode 100644 units/cn/unitbonus2/optuna.mdx create mode 100644 units/cn/unitbonus3/curriculum-learning.mdx create mode 100644 units/cn/unitbonus3/decision-transformers.mdx create mode 100644 units/cn/unitbonus3/envs-to-try.mdx create mode 100644 units/cn/unitbonus3/generalisation.mdx create mode 100644 units/cn/unitbonus3/godotrl.mdx create mode 100644 units/cn/unitbonus3/introduction.mdx create mode 100644 units/cn/unitbonus3/language-models.mdx create mode 100644 units/cn/unitbonus3/learning-agents.mdx create mode 100644 units/cn/unitbonus3/model-based.mdx create mode 100644 units/cn/unitbonus3/offline-online.mdx create mode 100644 units/cn/unitbonus3/rl-documentation.mdx create mode 100644 units/cn/unitbonus3/rlhf.mdx create mode 100644 units/cn/unitbonus3/student-works.mdx create mode 100644 units/cn/unitbonus5/conclusion.mdx create mode 100644 units/cn/unitbonus5/customize-the-environment.mdx create mode 100644 units/cn/unitbonus5/getting-started.mdx create mode 100644 units/cn/unitbonus5/introduction.mdx create mode 100644 units/cn/unitbonus5/the-environment.mdx create mode 100644 units/cn/unitbonus5/train-our-robot.mdx diff --git a/units/cn/_toctree.yml b/units/cn/_toctree.yml new file mode 100644 index 00000000..f96d14cd --- /dev/null +++ b/units/cn/_toctree.yml @@ -0,0 +1,260 @@ +- title: Unit 0. Welcome to the course + sections: + - local: unit0/introduction + title: Welcome to the course 🤗 + - local: unit0/setup + title: Setup + - local: unit0/discord101 + title: Discord 101 +- title: Unit 1. Introduction to Deep Reinforcement Learning + sections: + - local: unit1/introduction + title: Introduction + - local: unit1/what-is-rl + title: What is Reinforcement Learning? + - local: unit1/rl-framework + title: The Reinforcement Learning Framework + - local: unit1/tasks + title: The type of tasks + - local: unit1/exp-exp-tradeoff + title: The Exploration/ Exploitation tradeoff + - local: unit1/two-methods + title: The two main approaches for solving RL problems + - local: unit1/deep-rl + title: The “Deep” in Deep Reinforcement Learning + - local: unit1/summary + title: Summary + - local: unit1/glossary + title: Glossary + - local: unit1/hands-on + title: Hands-on + - local: unit1/quiz + title: Quiz + - local: unit1/conclusion + title: Conclusion + - local: unit1/additional-readings + title: Additional Readings +- title: Bonus Unit 1. Introduction to Deep Reinforcement Learning with Huggy + sections: + - local: unitbonus1/introduction + title: Introduction + - local: unitbonus1/how-huggy-works + title: How Huggy works? + - local: unitbonus1/train + title: Train Huggy + - local: unitbonus1/play + title: Play with Huggy + - local: unitbonus1/conclusion + title: Conclusion +- title: Live 1. How the course work, Q&A, and playing with Huggy + sections: + - local: live1/live1 + title: Live 1. How the course work, Q&A, and playing with Huggy 🐶 +- title: Unit 2. Introduction to Q-Learning + sections: + - local: unit2/introduction + title: Introduction + - local: unit2/what-is-rl + title: What is RL? A short recap + - local: unit2/two-types-value-based-methods + title: The two types of value-based methods + - local: unit2/bellman-equation + title: The Bellman Equation, simplify our value estimation + - local: unit2/mc-vs-td + title: Monte Carlo vs Temporal Difference Learning + - local: unit2/mid-way-recap + title: Mid-way Recap + - local: unit2/mid-way-quiz + title: Mid-way Quiz + - local: unit2/q-learning + title: Introducing Q-Learning + - local: unit2/q-learning-example + title: A Q-Learning example + - local: unit2/q-learning-recap + title: Q-Learning Recap + - local: unit2/glossary + title: Glossary + - local: unit2/hands-on + title: Hands-on + - local: unit2/quiz2 + title: Q-Learning Quiz + - local: unit2/conclusion + title: Conclusion + - local: unit2/additional-readings + title: Additional Readings +- title: Unit 3. Deep Q-Learning with Atari Games + sections: + - local: unit3/introduction + title: Introduction + - local: unit3/from-q-to-dqn + title: From Q-Learning to Deep Q-Learning + - local: unit3/deep-q-network + title: The Deep Q-Network (DQN) + - local: unit3/deep-q-algorithm + title: The Deep Q Algorithm + - local: unit3/glossary + title: Glossary + - local: unit3/hands-on + title: Hands-on + - local: unit3/quiz + title: Quiz + - local: unit3/conclusion + title: Conclusion + - local: unit3/additional-readings + title: Additional Readings +- title: Bonus Unit 2. Automatic Hyperparameter Tuning with Optuna + sections: + - local: unitbonus2/introduction + title: Introduction + - local: unitbonus2/optuna + title: Optuna + - local: unitbonus2/hands-on + title: Hands-on +- title: Unit 4. Policy Gradient with PyTorch + sections: + - local: unit4/introduction + title: Introduction + - local: unit4/what-are-policy-based-methods + title: What are the policy-based methods? + - local: unit4/advantages-disadvantages + title: The advantages and disadvantages of policy-gradient methods + - local: unit4/policy-gradient + title: Diving deeper into policy-gradient + - local: unit4/pg-theorem + title: (Optional) the Policy Gradient Theorem + - local: unit4/glossary + title: Glossary + - local: unit4/hands-on + title: Hands-on + - local: unit4/quiz + title: Quiz + - local: unit4/conclusion + title: Conclusion + - local: unit4/additional-readings + title: Additional Readings +- title: Unit 5. Introduction to Unity ML-Agents + sections: + - local: unit5/introduction + title: Introduction + - local: unit5/how-mlagents-works + title: How ML-Agents works? + - local: unit5/snowball-target + title: The SnowballTarget environment + - local: unit5/pyramids + title: The Pyramids environment + - local: unit5/curiosity + title: (Optional) What is curiosity in Deep Reinforcement Learning? + - local: unit5/hands-on + title: Hands-on + - local: unit5/bonus + title: Bonus. Learn to create your own environments with Unity and MLAgents + - local: unit5/quiz + title: Quiz + - local: unit5/conclusion + title: Conclusion +- title: Unit 6. Actor Critic methods with Robotics environments + sections: + - local: unit6/introduction + title: Introduction + - local: unit6/variance-problem + title: The Problem of Variance in Reinforce + - local: unit6/advantage-actor-critic + title: Advantage Actor Critic (A2C) + - local: unit6/hands-on + title: Advantage Actor Critic (A2C) using Robotics Simulations with Panda-Gym 🤖 + - local: unit6/quiz + title: Quiz + - local: unit6/conclusion + title: Conclusion + - local: unit6/additional-readings + title: Additional Readings +- title: Unit 7. Introduction to Multi-Agents and AI vs AI + sections: + - local: unit7/introduction + title: Introduction + - local: unit7/introduction-to-marl + title: An introduction to Multi-Agents Reinforcement Learning (MARL) + - local: unit7/multi-agent-setting + title: Designing Multi-Agents systems + - local: unit7/self-play + title: Self-Play + - local: unit7/hands-on + title: Let's train our soccer team to beat your classmates' teams (AI vs. AI) + - local: unit7/quiz + title: Quiz + - local: unit7/conclusion + title: Conclusion + - local: unit7/additional-readings + title: Additional Readings +- title: Unit 8. Part 1 Proximal Policy Optimization (PPO) + sections: + - local: unit8/introduction + title: Introduction + - local: unit8/intuition-behind-ppo + title: The intuition behind PPO + - local: unit8/clipped-surrogate-objective + title: Introducing the Clipped Surrogate Objective Function + - local: unit8/visualize + title: Visualize the Clipped Surrogate Objective Function + - local: unit8/hands-on-cleanrl + title: PPO with CleanRL + - local: unit8/conclusion + title: Conclusion + - local: unit8/additional-readings + title: Additional Readings +- title: Unit 8. Part 2 Proximal Policy Optimization (PPO) with Doom + sections: + - local: unit8/introduction-sf + title: Introduction + - local: unit8/hands-on-sf + title: PPO with Sample Factory and Doom + - local: unit8/conclusion-sf + title: Conclusion +- title: Bonus Unit 3. Advanced Topics in Reinforcement Learning + sections: + - local: unitbonus3/introduction + title: Introduction + - local: unitbonus3/model-based + title: Model-Based Reinforcement Learning + - local: unitbonus3/offline-online + title: Offline vs. Online Reinforcement Learning + - local: unitbonus3/generalisation + title: Generalisation Reinforcement Learning + - local: unitbonus3/rlhf + title: Reinforcement Learning from Human Feedback + - local: unitbonus3/decision-transformers + title: Decision Transformers and Offline RL + - local: unitbonus3/language-models + title: Language models in RL + - local: unitbonus3/curriculum-learning + title: (Automatic) Curriculum Learning for RL + - local: unitbonus3/envs-to-try + title: Interesting environments to try + - local: unitbonus3/learning-agents + title: An introduction to Unreal Learning Agents + - local: unitbonus3/godotrl + title: An Introduction to Godot RL + - local: unitbonus3/student-works + title: Students projects + - local: unitbonus3/rl-documentation + title: Brief introduction to RL documentation +- title: Bonus Unit 5. Imitation Learning with Godot RL Agents + sections: + - local: unitbonus5/introduction + title: Introduction + - local: unitbonus5/the-environment + title: The environment + - local: unitbonus5/getting-started + title: Getting started + - local: unitbonus5/train-our-robot + title: Train our robot + - local: unitbonus5/customize-the-environment + title: (Optional) Customize the environment + - local: unitbonus5/conclusion + title: Conclusion +- title: Certification and congratulations + sections: + - local: communication/conclusion + title: Congratulations + - local: communication/certification + title: Get your certificate of completion diff --git a/units/cn/communication/certification.mdx b/units/cn/communication/certification.mdx new file mode 100644 index 00000000..0326b224 --- /dev/null +++ b/units/cn/communication/certification.mdx @@ -0,0 +1,29 @@ +# 认证流程 + +认证流程**完全免费**: + +- 获取*完成证书*:你需要**通过80%的作业**。 +- 获取*优秀证书*:你需要**通过100%的作业**。 + +**没有截止日期,课程是自定进度的**。 + +课程认证 + +当我们说通过时,**我们的意思是你的模型必须被推送到Hub并获得等于或高于最低要求的结果**。 + +要检查你的进度以及哪些单元你已通过/未通过:https://huggingface.co/spaces/ThomasSimonini/Check-my-progress-Deep-RL-Course + +现在你已准备好进行认证流程,你需要: + +1. 前往:https://huggingface.co/spaces/huggingface-projects/Deep-RL-Course-Certification/ +2. 输入你的*hugging face用户名*、*名字*、*姓氏* + +3. 点击"生成我的证书"。 + - 如果你通过了80%的作业,**恭喜**你获得了完成证书。 + - 如果你通过了100%的作业,**恭喜**你获得了优秀证书。 + - 如果你低于80%,不要气馁!检查哪些单元你需要重做以获取证书。 + +4. 你可以下载PDF格式和PNG格式的证书。 + +欢迎在Twitter上分享你的证书(标记@ThomasSimonini和@huggingface)以及在LinkedIn上分享。 + diff --git a/units/cn/communication/conclusion.mdx b/units/cn/communication/conclusion.mdx new file mode 100644 index 00000000..bc4e73e3 --- /dev/null +++ b/units/cn/communication/conclusion.mdx @@ -0,0 +1,24 @@ +# 恭喜 + +缩略图 + + +**恭喜你完成本课程!** 通过坚持不懈、努力工作和决心,**你已经获得了深度强化学习的坚实基础**。 + +但完成本课程**并不是你旅程的终点**。这只是开始:不要犹豫,去探索奖励单元3,那里我们展示了你可能感兴趣的主题。也不要犹豫**分享你正在做的事情,并在discord服务器中提问** + +**感谢**你参与本课程。**我希望你喜欢这门课程,就像我喜欢编写它一样**。 + +欢迎**使用[此表单](https://forms.gle/BzKXWzLAGZESGNaE9)给我们反馈如何改进课程** + +别忘了**在下一部分查看如何获取(如果你通过了)你的完成证书‎‍🎓。** + +最后一件事,要与强化学习团队和我保持联系: + +- [在Twitter上关注我](https://twitter.com/thomassimonini) +- [关注Hugging Face的Twitter账号](https://twitter.com/huggingface) +- [加入Hugging Face Discord](https://www.hf.co/join/discord) + +## 持续学习,保持精彩 🤗 + +Thomas Simonini, diff --git a/units/cn/live1/live1.mdx b/units/cn/live1/live1.mdx new file mode 100644 index 00000000..cf53a356 --- /dev/null +++ b/units/cn/live1/live1.mdx @@ -0,0 +1,9 @@ +# 直播1:课程如何运作,问答,以及与Huggy互动 + +在这第一次直播中,我们解释了课程如何运作(范围、单元、挑战等)并回答了你们的问题。 + +最后,我们看了一些你们训练的月球着陆器代理,并与你们的Huggies🐶互动 + + + +要了解下一次直播的安排,**请查看discord服务器**。我们也会**给你发送电子邮件**。如果你不能参加,别担心,我们会录制直播内容。 \ No newline at end of file diff --git a/units/cn/unit0/discord101.mdx b/units/cn/unit0/discord101.mdx new file mode 100644 index 00000000..ea68592b --- /dev/null +++ b/units/cn/unit0/discord101.mdx @@ -0,0 +1,37 @@ +# Discord 101 [[discord-101]] + +嘿!我是Huggy,一只狗狗🐕,我期待在这个强化学习课程中与你一起训练! +虽然我对捡拾木棍知之甚少(目前如此),但我对Discord略知一二。所以我写了这份指南来帮助你了解它! + +Huggy Logo + +Discord是一个免费的聊天平台。如果你用过Slack,**它非常相似**。有一个拥有50000名成员的Hugging Face社区Discord服务器,你可以点击这里一键加入。这么多人类可以一起玩耍! + +刚开始使用Discord可能有点令人生畏,所以让我带你了解一下。 + +当你[注册我们的Discord服务器](http://hf.co/join/discord)时,你将选择你的兴趣。确保**点击"强化学习"**,你将获得访问包含所有课程相关频道的强化学习类别的权限。如果你想加入更多频道,尽管去做吧!🚀 + +然后点击下一步,你将在`#introduce-yourself`频道**介绍自己**。 + + +Discord + +它们位于强化学习类别中。**不要忘记通过在`role-assigment`中点击🤖强化学习来注册这些频道**。 +- `rl-announcements`:我们在这里提供**关于课程的最新信息**。 +- `rl-discussions`:你可以在这里**讨论强化学习并分享信息**。 +- `rl-study-group`:你可以在这里**提问并与同学交流**。 +- `rl-i-made-this`:你可以在这里**分享你的项目和模型**。 + +HF社区服务器有一个蓬勃发展的人类社区,他们对许多领域感兴趣,所以你也可以从中学习。有论文讨论、活动和许多其他内容。 + +这有用吗?我可以分享一些技巧: + +- 还有**语音频道**你也可以使用,尽管大多数人更喜欢文字聊天。 +- 你可以**使用markdown风格**进行文字聊天。所以如果你正在编写代码,你可以使用这种风格。可惜这对链接不太适用。 +- 你也可以开启线程!当**是一个长对话**时,这是个好主意。 + +希望这对你有用!如果你有问题,尽管问! + +回头见! + +Huggy 🐶 diff --git a/units/cn/unit0/introduction.mdx b/units/cn/unit0/introduction.mdx new file mode 100644 index 00000000..58e4e89b --- /dev/null +++ b/units/cn/unit0/introduction.mdx @@ -0,0 +1,136 @@ +# 欢迎来到 🤗 深度强化学习课程 [[introduction]] + +Deep RL Course thumbnail + +欢迎来到人工智能中最引人入胜的主题:**深度强化学习**。 + +本课程将**从入门到专家级别教授你深度强化学习**。它完全免费且开源! + +在这个介绍单元中,你将: + +- 了解更多关于**课程内容**。 +- **确定你要走的路径**(自学或认证流程)。 +- 了解更多关于你将参与的**AI对战AI挑战**。 +- 了解更多**关于我们**。 +- **创建你的Hugging Face账户**(免费)。 +- **注册我们的Discord服务器**,这是你可以与同学和我们(Hugging Face团队)交流的地方。 + +让我们开始吧! + +## 你能期待什么? [[expect]] + +在本课程中,你将: + +- 📖 在**理论和实践**中学习深度强化学习。 +- 🧑‍💻 学习**使用著名的深度强化学习库**,如[Stable Baselines3](https://stable-baselines3.readthedocs.io/en/master/)、[RL Baselines3 Zoo](https://github.com/DLR-RM/rl-baselines3-zoo)、[Sample Factory](https://samplefactory.dev/)和[CleanRL](https://github.com/vwxyzjn/cleanrl)。 +- 🤖 **在独特的环境中训练智能体**,如[SnowballFight](https://huggingface.co/spaces/ThomasSimonini/SnowballFight)、[Huggy the Doggo 🐶](https://huggingface.co/spaces/ThomasSimonini/Huggy)、[VizDoom (Doom)](https://vizdoom.cs.put.edu.pl/)以及经典环境如[Space Invaders](https://gymnasium.farama.org/environments/atari/space_invaders/)、[PyBullet](https://pybullet.org/wordpress/)等。 +- 💾 通过一行代码**将你训练的智能体分享到Hub**,并从社区下载强大的智能体。 +- 🏆 参与挑战,你将**评估你的智能体与其他团队相比的表现。你还将有机会与你训练的智能体对战**。 +- 🎓 通过完成80%的作业**获得完成证书**。 + +还有更多! + +在本课程结束时,**你将从基础到SOTA(最先进的)方法获得坚实的基础**。 + +不要忘记**注册课程**(我们收集你的电子邮件是为了能够**在每个单元发布时向你发送链接,并提供有关挑战和更新的信息**。) + +在这里注册 👉 这里 + + +## 课程是什么样的? [[course-look-like]] + +本课程由以下部分组成: + +- *理论部分*:你在理论上学习**概念**。 +- *实践部分*:你将学习**使用著名的深度强化学习库**来在独特的环境中训练你的智能体。这些实践将是**Google Colab笔记本,配有教程视频**,如果你更喜欢通过视频格式学习! + +- *挑战*:你将让你的智能体在不同的挑战中与其他智能体竞争。还将有[排行榜](https://huggingface.co/spaces/huggingface-projects/Deep-Reinforcement-Learning-Leaderboard)供你比较智能体的表现。 + +## 课程大纲是什么? [[syllabus]] + +这是课程的大纲: + +Syllabus Part 1 +Syllabus Part 2 + +## 两条路径:选择你自己的冒险 [[two-paths]] + +Two paths + +你可以选择以下方式学习本课程: + +- *获取完成证书*:你需要完成80%的作业。 +- *获取优秀证书*:你需要完成100%的作业。 +- *作为简单的旁听*:你可以参与所有挑战,如果你想的话也可以做作业。 + +**没有截止日期,课程是自定进度的**。 +两条路径**都是完全免费的**。 +无论你选择哪条路径,我们建议你**遵循推荐的学习节奏,与同学一起享受课程和挑战**。 + +你不需要告诉我们你选择了哪条路径。**如果你完成了超过80%的作业,你将获得证书**。 + +## 认证流程 [[certification-process]] + +认证流程**完全免费**: + +- *获取完成证书*:你需要完成80%的作业。 +- *获取优秀证书*:你需要完成100%的作业。 + +再次强调,**没有截止日期**,因为课程是自定进度的。但我们的建议**是遵循推荐的学习节奏部分**。 + +Course certification + +## 如何充分利用课程? [[advice]] + +为了充分利用课程,我们有一些建议: + +1. 在Discord中加入学习小组:小组学习总是更容易。为此,你需要加入我们的discord服务器。如果你是Discord新手,别担心!我们有一些工具可以帮助你了解它。 +2. **做测验和作业**:学习的最佳方式是实践和自我测试。 +3. **制定计划保持同步**:你可以使用下面我们推荐的学习节奏或创建自己的计划。 + +Course advice + +## 我需要哪些工具? [[tools]] + +你只需要3样东西: + +- *一台电脑*,有互联网连接。 +- *Google Colab(免费版)*:我们大多数实践将使用Google Colab,**免费版就足够了**。 +- 一个*Hugging Face账户*:用于推送和加载模型。如果你还没有账户,可以在**[这里](https://hf.co/join)**创建一个(免费)。 + +Course tools needed + + +## 推荐的学习节奏是什么? [[recommended-pace]] + +本课程的每一章都设计为**在1周内完成,每周大约需要3-4小时的工作**。但是,你可以根据需要花费尽可能多的时间来完成课程。如果你想更深入地研究某个主题,我们将提供额外的资源来帮助你实现这一目标。 + +## 我们是谁 [[who-are-we]] +关于作者: + +- Thomas Simonini是Hugging Face 🤗的开发者倡导者,专注于深度强化学习。他于2018年创立了深度强化学习课程,该课程成为深度强化学习领域中使用最广泛的课程之一。 + +关于团队: + +- Omar Sanseviero是Hugging Face的机器学习工程师,他在机器学习、社区和开源的交叉领域工作。此前,Omar在Google的Assistant和TensorFlow Graphics团队担任软件工程师。他来自秘鲁,喜欢羊驼🦙。 +- Sayak Paul是Hugging Face的开发者倡导工程师。他对表示学习领域(自监督、半监督、模型鲁棒性)感兴趣。他喜欢观看犯罪和动作惊悚片🔪。 + + +## 本课程中有哪些挑战? [[challenges]] + +在课程的这个新版本中,你有两种类型的挑战: +- [排行榜](https://huggingface.co/spaces/huggingface-projects/Deep-Reinforcement-Learning-Leaderboard),用于比较你的智能体与其他同学的智能体的表现。 +- [AI对战AI挑战](https://huggingface.co/learn/deep-rl-course/unit7/introduction?fw=pt),你可以训练你的智能体并与其他同学的智能体竞争。 + +Challenges + +## 我发现了一个bug,或者我想改进课程 [[contribute]] + +欢迎贡献 🤗 + +- 如果你*在笔记本中发现了一个bug 🐛*,请提出一个issue并**描述问题**。 +- 如果你*想改进课程*,你可以提交一个Pull Request。 + +## 我还有问题 [[questions]] + +请在我们的discord服务器 #rl-discussions中提问。 diff --git a/units/cn/unit0/setup.mdx b/units/cn/unit0/setup.mdx new file mode 100644 index 00000000..57bbea42 --- /dev/null +++ b/units/cn/unit0/setup.mdx @@ -0,0 +1,31 @@ +# 设置 [[setup]] + +在了解了所有这些信息后,是时候开始了。我们将做两件事: + +1. **创建你的Hugging Face账户**(如果还没有的话) +2. **注册Discord并介绍自己**(不要害羞🤗) + +### 让我们创建我的Hugging Face账户 + +(如果还没有的话)在这里创建一个HF账户 + +### 让我们加入我们的Discord服务器 + +你现在可以注册我们的Discord服务器。这是你**可以与社区和我们聊天,创建和加入学习小组一起成长等**的地方 + +👉🏻 在这里加入我们的discord服务器。 + +当你加入时,记得在#introduce-yourself中介绍自己,并在#channels-and-roles中注册强化学习频道。 + +我们有多个与强化学习相关的频道: +- `rl-announcements`:我们在这里提供关于课程的最新信息。 +- `rl-discussions`:你可以在这里讨论强化学习并分享信息。 +- `rl-study-group`:你可以在这里创建和加入学习小组。 +- `rl-i-made-this`:你可以在这里分享你的项目和模型。 + +如果这是你第一次使用Discord,我们写了一个Discord 101来获取最佳实践。查看下一部分。 + +恭喜!**你刚刚完成了入门**。你现在已准备好开始学习深度强化学习。祝你玩得开心! + + +### 持续学习,保持精彩 🤗 diff --git a/units/cn/unit1/additional-readings.mdx b/units/cn/unit1/additional-readings.mdx new file mode 100644 index 00000000..cfeb4a39 --- /dev/null +++ b/units/cn/unit1/additional-readings.mdx @@ -0,0 +1,14 @@ +# 额外阅读材料 [[additional-readings]] + +这些是**可选阅读材料**,如果你想深入学习。 + +## 深度强化学习 [[deep-rl]] + +- [强化学习导论,Richard Sutton和Andrew G. Barto著,第1、2和3章](http://incompleteideas.net/book/RLbook2020.pdf) +- [深度强化学习基础系列,L1 MDPs,精确解法,最大熵强化学习,Pieter Abbeel主讲](https://youtu.be/2GwBez0D20A) +- [OpenAI的Spinning Up RL,第1部分:强化学习的关键概念](https://spinningup.openai.com/en/latest/spinningup/rl_intro.html) + +## Gym [[gym]] + +- [OpenAI Gym入门:基本构建模块](https://blog.paperspace.com/getting-started-with-openai-gym/) +- [创建你自己的Gym自定义环境](https://www.gymlibrary.dev/content/environment_creation/) diff --git a/units/cn/unit1/conclusion.mdx b/units/cn/unit1/conclusion.mdx new file mode 100644 index 00000000..8903b2e1 --- /dev/null +++ b/units/cn/unit1/conclusion.mdx @@ -0,0 +1,21 @@ +# 结论 [[conclusion]] + +恭喜你完成本单元!**这是最大的一个单元**,包含了大量信息。同时恭喜你完成教程。你刚刚训练了你的第一个深度强化学习智能体并与社区分享了它们!🥳 + +如果你对其中的一些元素**仍然感到困惑是很正常的**。我和所有学习强化学习的人都曾有过同样的感受。 + +在继续之前**花时间真正理解这些材料**。在进入有趣的部分之前,掌握这些元素并建立坚实的基础很重要。 + +当然,在课程中,我们将再次使用和解释这些术语,但在深入学习下一个单元之前最好先理解它们。 + +在下一个(奖励)单元中,我们将通过**训练Huggy狗狗去捡拾木棍**来强化我们刚刚学到的知识。 + +然后你将能够与它一起玩耍🤗。 + +Huggy + +最后,我们非常希望**听到你对课程的看法以及我们如何改进它**。如果你有一些反馈,请👉 [填写此表单](https://forms.gle/BzKXWzLAGZESGNaE9) + +### 持续学习,保持精彩 🤗 + + diff --git a/units/cn/unit1/deep-rl.mdx b/units/cn/unit1/deep-rl.mdx new file mode 100644 index 00000000..b17e61d5 --- /dev/null +++ b/units/cn/unit1/deep-rl.mdx @@ -0,0 +1,20 @@ +# 强化学习中的"深度" [[deep-rl]] + + +到目前为止我们讨论的是强化学习。但"深度"在哪里发挥作用呢? + + +深度强化学习引入**深度神经网络来解决强化学习问题**——因此得名"深度"。 + +例如,在下一个单元中,我们将学习两种基于价值的算法:Q-Learning(经典强化学习)和Deep Q-Learning。 + +你会看到两者的区别在于,在第一种方法中,**我们使用传统算法**创建一个Q表,帮助我们找出在每个状态下应该采取什么行动。 + +在第二种方法中,**我们将使用神经网络**(来近似Q值)。 + +
+基于价值的强化学习 +
图表灵感来自Udacity的Q学习笔记本
+
+ +如果你对深度学习不熟悉,你绝对应该观看[FastAI的实用深度学习课程](https://course.fast.ai)(免费)。 diff --git a/units/cn/unit1/exp-exp-tradeoff.mdx b/units/cn/unit1/exp-exp-tradeoff.mdx new file mode 100644 index 00000000..0fc29708 --- /dev/null +++ b/units/cn/unit1/exp-exp-tradeoff.mdx @@ -0,0 +1,36 @@ +# 探索/利用权衡 [[exp-exp-tradeoff]] + +最后,在研究解决强化学习问题的不同方法之前,我们必须涵盖另一个非常重要的主题:*探索/利用权衡。* + +- *探索*是通过尝试随机动作来探索环境,以**找到关于环境的更多信息。** +- *利用*是**利用已知信息来最大化奖励。** + +记住,我们的强化学习智能体的目标是最大化预期的累积奖励。然而,**我们可能会陷入一个常见的陷阱**。 + +让我们举个例子: + +探索 + +在这个游戏中,我们的老鼠可以获得**无限量的小奶酪**(每个+1)。但在迷宫的顶部,有一大堆奶酪(+1000)。 + +然而,如果我们只专注于利用,我们的智能体将永远无法到达那一大堆奶酪。相反,它只会利用**最近的奖励来源**,即使这个来源很小(利用)。 + +但如果我们的智能体进行一点探索,它可以**发现大奖励**(一堆大奶酪)。 + +这就是我们所说的探索/利用权衡。我们需要平衡**探索环境**和**利用我们对环境已知的信息**之间的比例。 + +因此,我们必须**定义一个规则来帮助处理这种权衡**。我们将在未来的单元中看到处理它的不同方法。 + +如果这仍然令人困惑,**想想一个现实问题:选择餐厅的问题:** + + +
+探索 +
来源:伯克利AI课程
+
+ +- *利用*:你每天都去同一家你知道很好的餐厅,**冒着错过另一家更好餐厅的风险。** +- *探索*:尝试你从未去过的餐厅,冒着体验不好的风险,**但也有可能获得一次奇妙的体验。** + +总结一下: +探索利用权衡 diff --git a/units/cn/unit1/glossary.mdx b/units/cn/unit1/glossary.mdx new file mode 100644 index 00000000..ebec9c19 --- /dev/null +++ b/units/cn/unit1/glossary.mdx @@ -0,0 +1,70 @@ +# 术语表 [[glossary]] + +这是一个社区创建的术语表。欢迎贡献! + +### 智能体 + +智能体通过**试错学习做决策,从环境中获得奖励和惩罚**。 + +### 环境 + +环境是一个模拟世界,**智能体可以通过与之交互来学习**。 + +### 马尔可夫性质 + +它意味着我们的智能体采取的行动**仅取决于当前状态,而与过去的状态和行动无关**。 + +### 观察/状态 + +- **状态**:对世界状态的完整描述。 +- **观察**:对环境/世界状态的部分描述。 + +### 动作 + +- **离散动作**:有限数量的动作,如左、右、上和下。 +- **连续动作**:无限可能的动作;例如,在自动驾驶汽车的情况下,驾驶场景有无限可能发生的动作。 + +### 奖励和折扣 + +- **奖励**:强化学习中的基本因素。告诉智能体所采取的行动是好还是坏。 +- 强化学习算法专注于最大化**累积奖励**。 +- **奖励假设**:强化学习问题可以被表述为(累积)回报的最大化。 +- 进行**折扣**是因为在开始时获得的奖励比长期奖励更可能发生,因为它们比长期奖励更可预测。 + +### 任务 + +- **情节性**:有起点和终点。 +- **连续性**:有起点但没有终点。 + +### 探索与利用权衡 + +- **探索**:通过尝试随机动作来探索环境,从环境中获取反馈/回报/奖励。 +- **利用**:利用我们对环境的了解来获得最大奖励。 +- **探索-利用权衡**:它平衡了我们想要**探索**环境的程度和我们想要**利用**我们对环境所知道的信息的程度。 + +### 策略 + +- **策略**:被称为智能体的大脑。它告诉我们在给定状态下应该采取什么行动。 +- **最优策略**:当智能体按照它行动时,**最大化**预期回报的策略。它是通过*训练*学习的。 + +### 基于策略的方法: + +- 解决强化学习问题的一种方法。 +- 在这种方法中,直接学习策略。 +- 将每个状态映射到该状态下的最佳相应动作。或者映射到该状态下可能动作集合的概率分布。 + +### 基于价值的方法: + +- 解决强化学习问题的另一种方法。 +- 在这里,我们不是训练策略,而是训练一个**价值函数**,将每个状态映射到处于该状态的预期价值。 + +欢迎贡献 🤗 + +如果你想改进课程,你可以[提交一个Pull Request。](https://github.com/huggingface/deep-rl-class/pulls) + +这个术语表的实现要感谢: + +- [@lucifermorningstar1305](https://github.com/lucifermorningstar1305) +- [@daspartho](https://github.com/daspartho) +- [@misza222](https://github.com/misza222) + diff --git a/units/cn/unit1/hands-on.mdx b/units/cn/unit1/hands-on.mdx new file mode 100644 index 00000000..5cb86cfd --- /dev/null +++ b/units/cn/unit1/hands-on.mdx @@ -0,0 +1,702 @@ +# 训练你的第一个深度强化学习智能体 🤖 [[hands-on]] + + + + + + +现在你已经学习了强化学习的基础知识,你已经准备好训练你的第一个智能体并通过Hub与社区分享它了🔥: +一个月球着陆器智能体,它将学习如何正确地在月球上着陆 🌕 + +LunarLander + +最后,你将**把这个训练好的智能体上传到Hugging Face Hub 🤗,这是一个免费、开放的平台,人们可以在这里分享ML模型、数据集和演示。** + +感谢我们的排行榜,你将能够比较你的结果与其他同学的结果,并交流最佳实践来提高你的智能体的分数。谁将赢得第1单元的挑战🏆? + +为了验证这个实践环节的[认证过程](https://huggingface.co/deep-rl-course/en/unit0/introduction#certification-process),你需要将你训练好的模型推送到Hub并**获得 >= 200的结果**。 + +要找到你的结果,请前往[排行榜](https://huggingface.co/spaces/huggingface-projects/Deep-Reinforcement-Learning-Leaderboard)并找到你的模型,**结果 = 平均奖励 - 奖励的标准差** + +**如果你找不到你的模型,请前往页面底部并点击刷新按钮。** + +有关认证过程的更多信息,请查看此部分 👉 https://huggingface.co/deep-rl-course/en/unit0/introduction#certification-process + +你可以在这里查看你的进度 👉 https://huggingface.co/spaces/ThomasSimonini/Check-my-progress-Deep-RL-Course + +让我们开始吧!🚀 + +**要开始实践,请点击Open In Colab按钮** 👇 : + +[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/deep-rl-class/blob/master/notebooks/unit1/unit1.ipynb) + +我们强烈**建议学生使用Google Colab进行实践练习**,而不是在个人电脑上运行它们。 + +通过使用Google Colab,**你可以专注于学习和实验,而不必担心设置环境的技术方面**。 + +# 第1单元:训练你的第一个深度强化学习智能体 🤖 + +Unit 1 thumbnail + +在这个笔记本中,你将训练你的**第一个深度强化学习智能体**,一个月球着陆器智能体,它将学习如何**正确地在月球上着陆 🌕**。使用[Stable-Baselines3](https://stable-baselines3.readthedocs.io/en/master/),一个深度强化学习库,与社区分享它们,并尝试不同的配置 + + +### 环境 🎮 + +- [LunarLander-v2](https://gymnasium.farama.org/environments/box2d/lunar_lander/) + +### 使用的库 📚 + +- [Stable-Baselines3](https://stable-baselines3.readthedocs.io/en/master/) + +我们一直在努力改进我们的教程,所以**如果你在这个笔记本中发现一些问题**,请[在Github仓库上提出一个issue](https://github.com/huggingface/deep-rl-class/issues)。 + +## 本笔记本的目标 🏆 + +在笔记本结束时,你将: + +- 能够使用**Gymnasium**,环境库。 +- 能够使用**Stable-Baselines3**,深度强化学习库。 +- 能够**将你训练好的智能体推送到Hub**,并附带一个漂亮的视频回放和评估分数 🔥。 + + +## 本笔记本来自深度强化学习课程 + +Deep RL Course illustration + +在这个免费课程中,你将: + +- 📖 在**理论和实践**中学习深度强化学习。 +- 🧑‍💻 学习**使用著名的深度强化学习库**,如Stable Baselines3、RL Baselines3 Zoo、CleanRL和Sample Factory 2.0。 +- 🤖 在**独特的环境中训练智能体** +- 🎓 通过完成80%的作业**获得完成证书**。 + +还有更多! + +查看 📚 课程大纲 👉 https://simoninithomas.github.io/deep-rl-course + +不要忘记**注册课程**(我们收集你的电子邮件是为了能够**在每个单元发布时向你发送链接,并提供有关挑战和更新的信息**。) + +与我们保持联系和提问的最佳方式是**加入我们的discord服务器**,与社区和我们交流 👉🏻 https://discord.gg/ydHrjt3WP5 + +## 先决条件 🏗️ + +在深入笔记本之前,你需要: + +🔲 📝 **[阅读第0单元](https://huggingface.co/deep-rl-course/unit0/introduction)**,它为你提供了关于课程的所有**信息,并帮助你入门** 🤗 + +🔲 📚 **通过[阅读第1单元](https://huggingface.co/deep-rl-course/unit1/introduction)来了解强化学习的基础知识**(MC、TD、奖励假设...)。 + +## 深度强化学习的简要回顾 📚 + +The RL process + +让我们对第一单元中学到的内容做一个简要回顾: + +- 强化学习是一种**从行动中学习的计算方法**。我们构建一个智能体,通过**与环境进行试错交互**并接收奖励(负面或正面)作为反馈来从环境中学习。 + +- 任何强化学习智能体的目标都是**最大化其预期累积奖励**(也称为预期回报),因为强化学习基于*奖励假设*,即所有目标都可以描述为预期累积奖励的最大化。 + +- 强化学习过程是一个**循环,输出状态、动作、奖励和下一个状态的序列**。 + +- 为了计算预期累积奖励(预期回报),**我们对奖励进行折扣**:较早(在游戏开始时)获得的奖励更有可能发生,因为它们比长期未来奖励更可预测。 + +- 为了解决RL问题,你需要找到一个**最优策略**;策略是你的AI的"大脑",它会告诉你给定状态时要采取的动作。最优策略是最大化预期回报的策略。 + +有两种找到最优策略的方法: + +- 通过**直接训练策略**:策略学习方法。 +- 通过**训练价值函数**来告诉我们每个状态的预期回报,并使用这个函数来定义我们的策略:价值学习方法。 + +- 最后,我们谈到了深度强化学习,因为**我们引入了深度神经网络来估计要采取的动作(策略学习)或估计状态的价值(价值学习),因此得名"深度"。** + +# 让我们训练我们的第一个深度强化学习智能体并将其上传到Hub 🚀 + +## 获取证书 🎓 + +为了验证这个实践环节的[认证过程](https://huggingface.co/deep-rl-course/en/unit0/introduction#certification-process),你需要将你训练好的模型推送到Hub并**获得 >= 200的结果**。 + +要找到你的结果,请前往[排行榜](https://huggingface.co/spaces/huggingface-projects/Deep-Reinforcement-Learning-Leaderboard)并找到你的模型,**结果 = 平均奖励 - 奖励的标准差** + +有关认证过程的更多信息,请查看此部分 👉 https://huggingface.co/deep-rl-course/en/unit0/introduction#certification-process + +## 设置GPU 💪 + +- 为了**加速智能体的训练,我们将使用GPU**。为此,请转到`Runtime > Change Runtime type` + +GPU Step 1 + +- `Hardware Accelerator > GPU` + +GPU Step 2 + +## 安装依赖项并创建虚拟屏幕 🔽 + +第一步是安装依赖项,我们将安装多个依赖项。 + +- `gymnasium[box2d]`:包含LunarLander-v2环境🌛 +- `stable-baselines3[extra]`:深度强化学习库。 +- `huggingface_sb3`:Stable-baselines3的附加代码,用于从Hugging Face🤗Hub加载和上传模型。 + +为了更轻松,我们创建了一个脚本来安装所有这些依赖项。 + +```bash +apt install swig cmake +``` + +```bash +pip install -r https://raw.githubusercontent.com/huggingface/deep-rl-class/main/notebooks/unit1/requirements-unit1.txt +``` + +在笔记本中,我们需要生成一个回放视频。为此,使用colab,**我们需要有一个虚拟屏幕来渲染环境**(从而记录帧)。 + +因此,以下单元格将安装虚拟屏幕库并创建和运行虚拟屏幕🖥 + +```bash +sudo apt-get update +apt install python3-opengl +apt install ffmpeg +apt install xvfb +pip3 install pyvirtualdisplay +``` + +为了确保新安装的库被使用,**有时需要重新启动笔记本运行时**。下一个单元格将强制**运行时崩溃,因此你需要重新连接并从这里开始运行代码**。感谢这个技巧,**我们将能够运行我们的虚拟屏幕**。 + +```python +import os + +os.kill(os.getpid(), 9) +``` + +```python +# Virtual display +from pyvirtualdisplay import Display + +virtual_display = Display(visible=0, size=(1400, 900)) +virtual_display.start() +``` + +## 导入包 📦 + +一个附加库我们导入是huggingface_hub**以便能够从hub上传和下载训练好的模型**。 + + +Hugging Face Hub 🤗 作为一个中心平台,任何人都可以在这里分享和探索模型和数据集。它具有版本控制、指标、可视化和其他功能,这些功能将使你能够轻松地与他人协作。 + +你可以在这里查看所有可用的深度强化学习模型👉 https://huggingface.co/models?pipeline_tag=reinforcement-learning&sort=downloads + +🏋 包含我们环境的库叫做Gymnasium。 +**你将在深度强化学习中大量使用Gymnasium。** + +Gymnasium是**Gym库的新版本**,[由Farama基金会维护](https://farama.org/)。 + +```python +import gymnasium + +from huggingface_sb3 import load_from_hub, package_to_hub +from huggingface_hub import ( + notebook_login, +) # To log to our Hugging Face account to be able to upload models to the Hub. + +from stable_baselines3 import PPO +from stable_baselines3.common.env_util import make_vec_env +from stable_baselines3.common.evaluation import evaluate_policy +from stable_baselines3.common.monitor import Monitor +``` + +## 了解Gymnasium及其工作原理 🤖 + +🏋 包含我们环境的库叫做Gymnasium。 +**你将在深度强化学习中大量使用Gymnasium。** + +Gymnasium是**Gym库的新版本**,[由Farama基金会维护](https://farama.org/)。 + +Gymnasium库提供两件事: + +- 一个允许你**创建强化学习环境**的接口。 +- 一个**环境集合**(gym-control、atari、box2D等)。 + +让我们看一个例子,但首先让我们回顾一下强化学习循环。 + +强化学习过程 + +在每一步: +- 我们的智能体从**环境**接收一个**状态(S0)**——我们接收游戏的第一帧(环境)。 +- 基于该**状态(S0)**,智能体采取一个**动作(A0)**——我们的智能体将向右移动。 +- 环境转换到一个**新状态(S1)**——新的帧。 +- 环境给智能体一些**奖励(R1)**——我们没有死亡*(正奖励+1)*。 + + +使用Gymnasium: + +1️⃣ 我们使用`gymnasium.make()`创建我们的环境 + +2️⃣ 我们使用`observation = env.reset()`将环境重置为其初始状态 + +在每一步: + +3️⃣ 使用我们的模型获取一个动作(在我们的例子中,我们采取一个随机动作) + +4️⃣ 使用`env.step(action)`,我们在环境中执行这个动作并获得 +- `observation`:新的状态(st+1) +- `reward`:执行动作后获得的奖励 +- `terminated`:表示剧集是否终止(智能体达到终止状态) +- `truncated`:在这个新版本中引入,表示时间限制或者智能体是否超出环境边界等情况。 +- `info`:提供额外信息的字典(取决于环境)。 + +更多解释请查看这里 👉 https://gymnasium.farama.org/api/env/#gymnasium.Env.step + +如果剧集终止: +- 我们使用`observation = env.reset()`将环境重置为其初始状态 + +**让我们看一个例子!** 确保阅读代码 + + +```python +import gymnasium as gym + +# First, we create our environment called LunarLander-v2 +env = gym.make("LunarLander-v2") + +# Then we reset this environment +observation, info = env.reset() + +for _ in range(20): + # Take a random action + action = env.action_space.sample() + print("Action taken:", action) + + # Do this action in the environment and get + # next_state, reward, terminated, truncated and info + observation, reward, terminated, truncated, info = env.step(action) + + # If the game is terminated (in our case we land, crashed) or truncated (timeout) + if terminated or truncated: + # Reset the environment + print("Environment is reset") + observation, info = env.reset() + +env.close() +``` + +## 创建月球着陆器环境 🌛 并了解它如何工作 + +### 环境 🎮 + +在这第一个教程中,我们将训练我们的智能体,一个[月球着陆器](https://gymnasium.farama.org/environments/box2d/lunar_lander/),**在月球上正确着陆**。为此,智能体需要学习**调整其速度和位置(水平、垂直和角度)以正确着陆。** + +--- + + +💡 当你开始使用一个环境时,一个好习惯是查看其文档 + +👉 https://gymnasium.farama.org/environments/box2d/lunar_lander/ + +--- + + +让我们看看环境是什么样子: + + +```python +# We create our environment with gym.make("") +env = gym.make("LunarLander-v2") +env.reset() +print("_____OBSERVATION SPACE_____ \n") +print("Observation Space Shape", env.observation_space.shape) +print("Sample observation", env.observation_space.sample()) # Get a random observation +``` + +我们发现`Observation Space Shape (8,)`,观察是一个大小为8的向量,其中每个值包含不同的信息: +- 水平板坐标(x) +- 垂直板坐标(y) +- 水平速度(x) +- 垂直速度(y) +- 角度 +- 角速度 +- 如果左腿接触点接触地面(布尔值) +- 如果右腿接触点接触地面(布尔值) + + +```python +print("\n _____ACTION SPACE_____ \n") +print("Action Space Shape", env.action_space.n) +print("Action Space Sample", env.action_space.sample()) # Take a random action +``` + +动作空间(智能体可以采取的可能动作集)是离散的,有4个可用动作🎮: + +- 动作0:什么都不做, +- 动作1:开左方向引擎, +- 动作2:开主引擎, +- 动作3:开右方向引擎。 + +奖励函数(在每个时间步给予奖励的函数): + +每一步都会授予奖励。一个剧集的总奖励是**该剧集中所有步骤的奖励之和**。 + +对于每一步,奖励: + +- 如果着陆器与着陆板更接近/更远,则增加/减少。 +- 如果着陆器移动得更慢/更快,则增加/减少。 +- 如果着陆器倾斜(角度不是水平),则减少。 +- 如果每条腿都接触地面,则每条腿增加10分。 +- 如果每帧侧引擎点火,则每帧减少0.03分。 +- 如果每帧主引擎点火,则每帧减少0.3分。 + +该剧集将收到**额外奖励-100或+100分,以分别因坠毁或安全着陆而结束**。 + +一个剧集被**认为是一个解决方案,如果它得分至少200分**。 + +#### Vectorized Environment + +- 我们创建一个向量化环境(一种将多个独立环境堆叠到一个环境中的方法),这样**我们将在训练期间拥有更多多样化的体验**。 + +```python +# Create the environment +env = make_vec_env("LunarLander-v2", n_envs=16) +``` + +## Create the Model 🤖 + +- 我们已经研究了我们的环境,并且理解了问题:能够通过控制左、右和主方向引擎正确地将月球着陆器降落到着陆板上。现在让我们构建我们将用来解决这个问题的算法 🚀. + +- 我们已经研究了我们的环境并理解了问题:**能够通过控制左、右和主方向引擎来正确地在月球上着陆**。现在让我们构建我们将使用的算法来解决这个问题🚀。 + +- 为此,我们将使用我们的第一个深度强化学习库,[Stable Baselines3 (SB3)](https://stable-baselines3.readthedocs.io/en/master/)。 + +- SB3是一组**可靠的PyTorch强化学习算法实现**。 + +💡 当你使用新库时,首先查看文档是一个好习惯:https://stable-baselines3.readthedocs.io/en/master/ and then try some tutorials. + +---- + +Stable Baselines3 + +为了解决这个问题,我们将使用SB3 **PPO**。[PPO (aka Proximal Policy Optimization) is one of the SOTA (state of the art) Deep Reinforcement Learning algorithms that you'll study during this course](https://stable-baselines3.readthedocs.io/en/master/modules/ppo.html#example%5D). + +PPO是一种组合: +- *基于价值的强化学习方法*:学习一个动作-价值函数,告诉我们**在给定状态和动作下最有价值的动作**。 +- *基于策略的强化学习方法*:学习一个策略,**给我们一个动作的概率分布**。 + +Stable-Baselines3设置起来很简单: + +1️⃣ 你**创建你的环境**(在我们的例子中,这已经在上面完成了) + +2️⃣ 你定义**你想要使用的模型并实例化这个模型** `model = PPO("MlpPolicy")` + +3️⃣ 你用`model.learn`**训练智能体**并定义训练时间步数 + +``` +# Create environment +env = gym.make('LunarLander-v2') + +# Instantiate the agent +model = PPO('MlpPolicy', env, verbose=1) +# Train the agent +model.learn(total_timesteps=int(2e5)) +``` + + + +```python +# TODO: Define a PPO MlpPolicy architecture +# We use MultiLayerPerceptron (MLPPolicy) because the input is a vector, +# if we had frames as input we would use CnnPolicy +model = +``` + +#### Solution + +```python +# SOLUTION +# We added some parameters to accelerate the training +model = PPO( + policy="MlpPolicy", + env=env, + n_steps=1024, + batch_size=64, + n_epochs=4, + gamma=0.999, + gae_lambda=0.98, + ent_coef=0.01, + verbose=1, +) +``` + +## 训练PPO智能体 🏃 +- 让我们训练我们的智能体1,000,000个时间步,不要忘记在Colab上使用GPU。这将花费大约~20分钟,但如果你只是想尝试一下,你可以使用更少的时间步。 +- 在训练期间,休息一下,喝杯☕,你应得的 🤗 + +```python +# TODO: Train it for 1,000,000 timesteps + +# TODO: Specify file name for model and save the model to file +model_name = "ppo-LunarLander-v2" +``` + +#### Solution + +```python +# SOLUTION +# Train it for 1,000,000 timesteps +model.learn(total_timesteps=1000000) +# Save the model +model_name = "ppo-LunarLander-v2" +model.save(model_name) +``` + +## 评估智能体 📈 + +- 记得用[Monitor](https://stable-baselines3.readthedocs.io/en/master/common/monitor.html)包装环境。 +- 现在我们的月球着陆器智能体已经训练好了 🚀,我们需要**检查它的性能**。 +- Stable-Baselines3提供了一个方法来做这个:`evaluate_policy`。 +- 要填写这部分,你需要[查看文档](https://stable-baselines3.readthedocs.io/en/master/guide/examples.html#basic-usage-training-saving-loading) +- 在下一步,我们将看到**如何自动评估并分享你的智能体以在排行榜上竞争,但现在让我们自己来做** + + +💡 当你评估你的智能体时,你不应该使用你的训练环境,而是创建一个评估环境。 + +```python +# TODO: Evaluate the agent +# Create a new environment for evaluation +eval_env = + +# Evaluate the model with 10 evaluation episodes and deterministic=True +mean_reward, std_reward = + +# Print the results +``` + +#### Solution + +```python +# @title +eval_env = Monitor(gym.make("LunarLander-v2")) +mean_reward, std_reward = evaluate_policy(model, eval_env, n_eval_episodes=10, deterministic=True) +print(f"mean_reward={mean_reward:.2f} +/- {std_reward}") +``` + +- 在我的例子中,我在训练100万步后得到了`200.20 +/- 20.80`的平均奖励,这意味着我们的月球着陆器智能体已经准备好登陆月球了 🌛🥳。 + +## 在Hub上发布我们训练好的模型 🔥 +现在我们看到训练后得到了好的结果,我们可以用一行代码将我们训练好的模型发布到hub 🤗 上。 + +📚 库文档 👉 https://github.com/huggingface/huggingface_sb3/tree/main#hugging-face--x-stable-baselines3-v20 + +这里是一个模型卡片的例子(使用太空入侵者): + +通过使用`package_to_hub`,**你可以评估、记录回放、生成你的智能体的模型卡片并将其推送到hub**。 + +这样: +- 你可以**展示我们的工作** 🔥 +- 你可以**可视化你的智能体的游戏过程** 👀 +- 你可以**与社区分享一个其他人可以使用的智能体** 💾 +- 你可以**访问一个排行榜 🏆 来看看你的智能体与你的同学相比表现如何** 👉 https://huggingface.co/spaces/huggingface-projects/Deep-Reinforcement-Learning-Leaderboard + + +要能够与社区分享你的模型,还有三个步骤需要遵循: + +1️⃣ (如果还没有完成)在Hugging Face上创建一个账户 ➡ https://huggingface.co/join + +2️⃣ 登录,然后,你需要从Hugging Face网站存储你的认证令牌。 +- 创建一个新的令牌(https://huggingface.co/settings/tokens)**具有写入角色** + +创建HF令牌 + +- 复制令牌 +- 运行下面的单元格并粘贴令牌 + +```python +notebook_login() +!git config --global credential.helper store +``` + +如果你不想使用Google Colab或Jupyter Notebook,你需要使用这个命令:`huggingface-cli login` + +3️⃣ 我们现在准备使用`package_to_hub()`函数将我们训练好的智能体推送到🤗 Hub 🔥 + +让我们填写`package_to_hub`函数: +- `model`:我们训练好的模型。 +- `model_name`:我们在`model_save`中定义的训练模型的名称 +- `model_architecture`:我们使用的模型架构,在我们的例子中是PPO +- `env_id`:环境的名称,在我们的例子中是`LunarLander-v2` +- `eval_env`:在eval_env中定义的评估环境 +- `repo_id`:将要创建/更新的Hugging Face Hub仓库的名称`(repo_id = {username}/{repo_name})` + +💡 **一个好的名称是`{username}/{model_architecture}-{env_id}`** + +- `commit_message`:提交的消息 + +```python +import gymnasium as gym +from stable_baselines3.common.vec_env import DummyVecEnv +from stable_baselines3.common.env_util import make_vec_env + +from huggingface_sb3 import package_to_hub + +## TODO: 定义一个repo_id +## repo_id是Hugging Face Hub上模型仓库的ID(repo_id = {组织}/{仓库名称},例如ThomasSimonini/ppo-LunarLander-v2 +repo_id = + +# TODO: 定义环境的名称 +env_id = + +# 创建评估环境并设置render_mode="rgb_array" +eval_env = DummyVecEnv([lambda: gym.make(env_id, render_mode="rgb_array")]) + + +# TODO: 定义我们使用的模型架构 +model_architecture = "" + +## TODO: 定义提交消息 +commit_message = "" + +# 方法保存、评估、生成模型卡片并在将仓库推送到hub之前记录智能体的回放视频 +package_to_hub(model=model, # 我们训练好的模型 + model_name=model_name, # 我们训练好的模型的名称 + model_architecture=model_architecture, # 我们使用的模型架构:在我们的例子中是PPO + env_id=env_id, # 环境的名称 + eval_env=eval_env, # 评估环境 + repo_id=repo_id, # Hugging Face Hub上模型仓库的ID(repo_id = {组织}/{仓库名称},例如ThomasSimonini/ppo-LunarLander-v2 + commit_message=commit_message) +``` + +#### 解决方案 + + +```python +import gymnasium as gym + +from stable_baselines3 import PPO +from stable_baselines3.common.vec_env import DummyVecEnv +from stable_baselines3.common.env_util import make_vec_env + +from huggingface_sb3 import package_to_hub + +# 放置你刚刚在上面两个单元格中定义的变量 +# 定义环境的名称 +env_id = "LunarLander-v2" + +# TODO: 定义我们使用的模型架构 +model_architecture = "PPO" + +## 定义一个repo_id +## repo_id是Hugging Face Hub上模型仓库的ID(repo_id = {组织}/{仓库名称},例如ThomasSimonini/ppo-LunarLander-v2 +## 更改为你的REPO ID +repo_id = "ThomasSimonini/ppo-LunarLander-v2" # 更改为你的repo id,你不能用我的推送 😄 + +## 定义提交消息 +commit_message = "上传PPO LunarLander-v2训练好的智能体" + +# 创建评估环境并设置render_mode="rgb_array" +eval_env = DummyVecEnv([lambda: Monitor(gym.make(env_id, render_mode="rgb_array"))]) + +# 在这里放置你刚刚填写的package_to_hub函数 +package_to_hub( + model=model, # 我们训练好的模型 + model_name=model_name, # 我们训练好的模型的名称 + model_architecture=model_architecture, # 我们使用的模型架构:在我们的例子中是PPO + env_id=env_id, # 环境的名称 + eval_env=eval_env, # 评估环境 + repo_id=repo_id, # Hugging Face Hub上模型仓库的ID(repo_id = {组织}/{仓库名称},例如ThomasSimonini/ppo-LunarLander-v2 + commit_message=commit_message, +) +``` + +恭喜 🥳 你刚刚训练并上传了你的第一个深度强化学习智能体。上面的脚本应该已经显示了一个模型仓库的链接,如https://huggingface.co/osanseviero/test_sb3。当你访问这个链接时,你可以: +* 在右侧看到你的智能体的视频预览。 +* 点击"Files and versions"查看仓库中的所有文件。 +* 点击"Use in stable-baselines3"获取显示如何加载模型的代码片段。 +* 一个模型卡片(`README.md`文件),提供模型的描述 + +在底层,Hub使用基于git的仓库(如果你不知道git是什么,不用担心),这意味着你可以在实验和改进你的智能体时用新版本更新模型。 + +使用排行榜比较你的LunarLander-v2与你的同学的结果 🏆 👉 https://huggingface.co/spaces/huggingface-projects/Deep-Reinforcement-Learning-Leaderboard + +## 从Hub加载保存的LunarLander模型 🤗 +感谢[ironbar](https://github.com/ironbar)的贡献。 + +从Hub加载保存的模型非常简单。 + +你可以前往https://huggingface.co/models?library=stable-baselines3 查看所有保存的Stable-baselines3模型的列表。 +1. 你选择一个并复制其repo_id + +复制ID + +2. 然后我们只需要使用load_from_hub,包含: +- repo_id +- filename:仓库内保存的模型及其扩展名(*.zip) + +因为我从Hub下载的模型是用Gym(Gymnasium的前一个版本)训练的,我们需要安装shimmy,这是一个API转换工具,它将帮助我们正确运行环境。 + +Shimmy文档:https://github.com/Farama-Foundation/Shimmy + +```python +!pip install shimmy +``` + +```python +from huggingface_sb3 import load_from_hub + +repo_id = "Classroom-workshop/assignment2-omar" # repo_id +filename = "ppo-LunarLander-v2.zip" # 模型文件名.zip + +# 当模型在Python 3.8上训练时,pickle协议是5 +# 但Python 3.6, 3.7使用协议4 +# 为了获得兼容性,我们需要: +# 1. 安装pickle5(我们在colab开始时已经完成) +# 2. 创建一个自定义的空对象,我们将其作为参数传递给PPO.load() +custom_objects = { + "learning_rate": 0.0, + "lr_schedule": lambda _: 0.0, + "clip_range": lambda _: 0.0, +} + +checkpoint = load_from_hub(repo_id, filename) +model = PPO.load(checkpoint, custom_objects=custom_objects, print_system_info=True) +``` + +让我们评估这个智能体: + +```python +# @title +eval_env = Monitor(gym.make("LunarLander-v2")) +mean_reward, std_reward = evaluate_policy(model, eval_env, n_eval_episodes=10, deterministic=True) +print(f"mean_reward={mean_reward:.2f} +/- {std_reward}") +``` + +## 一些额外的挑战 🏆 +学习的最好方法**是自己尝试**!正如你所看到的,当前的智能体表现不是很好。作为第一个建议,你可以训练更多步骤。使用1,000,000步,我们看到了一些很好的结果! + +在[排行榜](https://huggingface.co/spaces/huggingface-projects/Deep-Reinforcement-Learning-Leaderboard)中,你会找到你的智能体。你能登上榜首吗? + +以下是一些实现这一目标的想法: +* 训练更多步骤 +* 尝试`PPO`的不同超参数。你可以在https://stable-baselines3.readthedocs.io/en/master/modules/ppo.html#parameters 查看它们。 +* 查看[Stable-Baselines3文档](https://stable-baselines3.readthedocs.io/en/master/modules/dqn.html)并尝试另一个模型,如DQN。 +* **将你新训练的模型**推送到Hub 🔥 + +**使用[排行榜](https://huggingface.co/spaces/huggingface-projects/Deep-Reinforcement-Learning-Leaderboard)比较你的LunarLander-v2与你的同学的结果** 🏆 + +月球着陆对你来说太无聊了吗?尝试**改变环境**,为什么不使用MountainCar-v0、CartPole-v1或CarRacing-v0?查看它们如何工作[使用gym文档](https://www.gymlibrary.dev/)并享受乐趣 🎉。 + +________________________________________________________________________ +恭喜你完成本章!这是最大的一章,**包含了大量信息。** + +如果你仍然对所有这些元素感到困惑...这完全正常!**这对我和所有学习强化学习的人来说都是一样的。** + +花时间真正**理解材料,然后再继续并尝试额外的挑战**。掌握这些元素并建立坚实的基础很重要。 + +当然,在课程中,我们将深入探讨这些概念,但**在深入下一章之前,最好对它们有一个良好的理解。** + + +下次,在奖励单元1中,你将训练Huggy狗去捡拾木棍。 + +Huggy + +## 继续学习,保持精彩 🤗 diff --git a/units/cn/unit1/introduction.mdx b/units/cn/unit1/introduction.mdx new file mode 100644 index 00000000..50068700 --- /dev/null +++ b/units/cn/unit1/introduction.mdx @@ -0,0 +1,27 @@ +# 深度强化学习简介 [[introduction-to-deep-reinforcement-learning]] + +Unit 1 thumbnail + + +欢迎来到人工智能中最引人入胜的主题:**深度强化学习**。 + +深度强化学习是一种机器学习类型,其中智能体通过**执行动作**并**观察结果**来学习**如何在环境中行动**。 + +在这第一单元中,**你将学习深度强化学习的基础知识。** + + +然后,你将**训练你的深度强化学习智能体,一个月球着陆器,使用Stable-Baselines3(一个深度强化学习库)正确地降落在月球上**。 + + +LunarLander + +最后,你将**把这个训练好的智能体上传到Hugging Face Hub 🤗,这是一个免费、开放的平台,人们可以在这里分享机器学习模型、数据集和演示。** + +在深入实现深度强化学习智能体之前,**掌握这些元素至关重要**。本章的目标是给你坚实的基础。 + + +完成本单元后,在一个奖励单元中,你将**能够训练Huggy狗🐶去捡拾木棍并与它一起玩耍🤗**。 + +