diff --git a/notebooks/bonus-unit1/bonus-unit1.ipynb b/notebooks/bonus-unit1/bonus-unit1.ipynb
index 522ec13..41229cc 100644
--- a/notebooks/bonus-unit1/bonus-unit1.ipynb
+++ b/notebooks/bonus-unit1/bonus-unit1.ipynb
@@ -37,22 +37,12 @@
{
"cell_type": "markdown",
"source": [
- "TODO: ADD TEXT LIVE INFO"
- ],
- "metadata": {
- "id": "QQnzAjfcIO2z"
- }
- },
- {
- "cell_type": "markdown",
- "source": [
- "TODO: ADD IF YOU HAVE QUESTIONS\n",
- "\n",
- "\n",
"### The environment ๐ฎ\n",
+ "\n",
"- Huggy the Dog, an environment created by [Thomas Simonini](https://twitter.com/ThomasSimonini) based on [Puppo The Corgi](https://blog.unity.com/technology/puppo-the-corgi-cuteness-overload-with-the-unity-ml-agents-toolkit)\n",
"\n",
"### The library used ๐\n",
+ "\n",
"- [MLAgents (Hugging Face version)](https://github.com/huggingface/ml-agents)"
],
"metadata": {
@@ -72,7 +62,9 @@
"cell_type": "markdown",
"source": [
"## Objectives of this notebook ๐\n",
+ "\n",
"At the end of the notebook, you will:\n",
+ "\n",
"- Understand **the state space, action space and reward function used to train Huggy**.\n",
"- **Train your own Huggy** to fetch the stick.\n",
"- Be able to play **with your trained Huggy directly in your browser**.\n",
@@ -117,11 +109,12 @@
"cell_type": "markdown",
"source": [
"## Prerequisites ๐๏ธ\n",
+ "\n",
"Before diving into the notebook, you need to:\n",
"\n",
- "๐ฒ ๐ **Develop an understanding of the foundations of Reinforcement learning** (MC, TD, Rewards hypothesis...) by doing Unit 1 ๐ ADD LINK\n",
+ "๐ฒ ๐ **Develop an understanding of the foundations of Reinforcement learning** (MC, TD, Rewards hypothesis...) by doing Unit 1\n",
"\n",
- "๐ฒ ๐ **Read the introduction to Huggy** by doing Bonus Unit 1 ๐ ADD LINK\n"
+ "๐ฒ ๐ **Read the introduction to Huggy** by doing Bonus Unit 1"
],
"metadata": {
"id": "6r7Hl0uywFSO"
@@ -134,6 +127,7 @@
},
"source": [
"## Clone the repository and install the dependencies ๐ฝ\n",
+ "\n",
"- We need to clone the repository, that **contains the experimental version of the library that allows you to push your trained agent to the Hub.**"
]
},
@@ -172,6 +166,7 @@
},
"source": [
"## Download and move the environment zip file in `./trained-envs-executables/linux/`\n",
+ "\n",
"- Our environment executable is in a zip file.\n",
"- We need to download it and place it to `./trained-envs-executables/linux/`"
]
@@ -244,9 +239,11 @@
"cell_type": "markdown",
"source": [
"## Let's recap how this environment works\n",
+ "\n",
"### The State Space: what Huggy \"perceives.\"\n",
"\n",
"Huggy doesn't \"see\" his environment. Instead, we provide him information about the environment:\n",
+ "\n",
"- The target (stick) position\n",
"- The relative position between himself and the target\n",
"- The orientation of his legs.\n",
@@ -286,9 +283,8 @@
"cell_type": "markdown",
"source": [
"## Check the Huggy config file\n",
+ "\n",
"- In ML-Agents, you define the **training hyperparameters into config.yaml files.**\n",
- "For this first training, weโll modify one thing:\n",
- "- The total training steps hyperparameter is too 2M that's enough for having very good results.\n",
"\n",
"- For the scope of this notebook, we're not going to modify the hyperparameters but if you want to try as an experimentation, you should also try to modify some other hyperparameters, Unity provides a very [good documentation explaining each of them here](https://github.com/Unity-Technologies/ml-agents/blob/main/docs/Training-Configuration-File.md)."
],
@@ -360,6 +356,7 @@
},
"source": [
"## Push the agent to the ๐ค Hub\n",
+ "\n",
"- Now that we trained our agent, weโre **ready to push it to the Hub to be able to play with Huggy on your browser๐ฅ.**"
]
},
diff --git a/notebooks/bonus-unit1/bonus-unit1.mdx b/notebooks/bonus-unit1/bonus-unit1.mdx
new file mode 100644
index 0000000..94b613b
--- /dev/null
+++ b/notebooks/bonus-unit1/bonus-unit1.mdx
@@ -0,0 +1,256 @@
+# Bonus Unit 1: Let's train Huggy the Dog ๐ถ to fetch a stick
+
+
+
+In this notebook, we'll reinforce what we learn in the first Unit by **teaching Huggy the Dog to fetch the stick and then play with it directly in your browser**
+
+โฌ๏ธ Here is an example of what **you will achieve at the end of the unit.** โฌ๏ธ (launch โถ to see)
+
+```python
+%%html
+
+```
+
+### The environment ๐ฎ
+
+- Huggy the Dog, an environment created by [Thomas Simonini](https://twitter.com/ThomasSimonini) based on [Puppo The Corgi](https://blog.unity.com/technology/puppo-the-corgi-cuteness-overload-with-the-unity-ml-agents-toolkit)
+
+### The library used ๐
+
+- [MLAgents (Hugging Face version)](https://github.com/huggingface/ml-agents)
+
+We're constantly trying to improve our tutorials, so **if you find some issues in this notebook**, please [open an issue on the Github Repo](https://github.com/huggingface/deep-rl-class/issues).
+
+## Objectives of this notebook ๐
+
+At the end of the notebook, you will:
+
+- Understand **the state space, action space and reward function used to train Huggy**.
+- **Train your own Huggy** to fetch the stick.
+- Be able to play **with your trained Huggy directly in your browser**.
+
+
+
+
+## This notebook is from Deep Reinforcement Learning Course
+
+
+In this free course, you will:
+
+- ๐ Study Deep Reinforcement Learning in **theory and practice**.
+- ๐งโ๐ป Learn to **use famous Deep RL libraries** such as Stable Baselines3, RL Baselines3 Zoo, CleanRL and Sample Factory 2.0.
+- ๐ค Train **agents in unique environments**
+
+And more check ๐ the syllabus ๐ https://simoninithomas.github.io/deep-rl-course
+
+Donโt forget to **sign up to the course** (we are collecting your email to be able toย **send you the links when each Unit is published and give you information about the challenges and updates).**
+
+
+The best way to keep in touch is to join our discord server to exchange with the community and with us ๐๐ป https://discord.gg/ydHrjt3WP5
+
+## Prerequisites ๐๏ธ
+
+Before diving into the notebook, you need to:
+
+๐ฒ ๐ **Develop an understanding of the foundations of Reinforcement learning** (MC, TD, Rewards hypothesis...) by doing Unit 1
+
+๐ฒ ๐ **Read the introduction to Huggy** by doing Bonus Unit 1
+
+## Clone the repository and install the dependencies ๐ฝ
+
+- We need to clone the repository, that **contains the experimental version of the library that allows you to push your trained agent to the Hub.**
+
+```python
+%%capture
+# Clone this specific repository (can take 3min)
+!git clone https://github.com/huggingface/ml-agents/
+```
+
+```python
+%%capture
+# Go inside the repository and install the package (can take 3min)
+%cd ml-agents
+!pip3 install -e ./ml-agents-envs
+!pip3 install -e ./ml-agents
+```
+
+## Download and move the environment zip file in `./trained-envs-executables/linux/`
+
+- Our environment executable is in a zip file.
+- We need to download it and place it to `./trained-envs-executables/linux/`
+
+```python
+!mkdir ./trained-envs-executables
+!mkdir ./trained-envs-executables/linux
+```
+
+```python
+!wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=1zv3M95ZJTWHUVOWT6ckq_cm98nft8gdF' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=1zv3M95ZJTWHUVOWT6ckq_cm98nft8gdF" -O ./trained-envs-executables/linux/Huggy.zip && rm -rf /tmp/cookies.txt
+```
+
+Download the file Huggy.zip from https://drive.google.com/uc?export=download&id=1zv3M95ZJTWHUVOWT6ckq_cm98nft8gdF using `wget`. Check out the full solution to download large files from GDrive [here](https://bcrf.biochem.wisc.edu/2021/02/05/download-google-drive-files-using-wget/)
+
+```python
+%%capture
+!unzip -d ./trained-envs-executables/linux/ ./trained-envs-executables/linux/Huggy.zip
+```
+
+Make sure your file is accessible
+
+```python
+!chmod -R 755 ./trained-envs-executables/linux/Huggy
+```
+
+## Let's recap how this environment works
+
+### The State Space: what Huggy "perceives."
+
+Huggy doesn't "see" his environment. Instead, we provide him information about the environment:
+
+- The target (stick) position
+- The relative position between himself and the target
+- The orientation of his legs.
+
+Given all this information, Huggy **can decide which action to take next to fulfill his goal**.
+
+
+
+
+### The Action Space: what moves Huggy can do
+
+
+**Joint motors drive huggy legs**. It means that to get the target, Huggy needs to **learn to rotate the joint motors of each of his legs correctly so he can move**.
+
+### The Reward Function
+
+The reward function is designed so that **Huggy will fulfill his goal** : fetch the stick.
+
+Remember that one of the foundations of Reinforcement Learning is the *reward hypothesis*: a goal can be described as the **maximization of the expected cumulative reward**.
+
+Here, our goal is that Huggy **goes towards the stick but without spinning too much**. Hence, our reward function must translate this goal.
+
+Our reward function:
+
+
+
+- *Orientation bonus*: we **reward him for getting close to the target**.
+- *Time penalty*: a fixed-time penalty given at every action to **force him to get to the stick as fast as possible**.
+- *Rotation penalty*: we penalize Huggy if **he spins too much and turns too quickly**.
+- *Getting to the target reward*: we reward Huggy for **reaching the target**.
+
+## Check the Huggy config file
+
+- In ML-Agents, you define the **training hyperparameters into config.yaml files.**
+
+- For the scope of this notebook, we're not going to modify the hyperparameters but if you want to try as an experimentation, you should also try to modify some other hyperparameters, Unity provides a very [good documentation explaining each of them here](https://github.com/Unity-Technologies/ml-agents/blob/main/docs/Training-Configuration-File.md).
+
+- Click here to open the config.yaml: `/content/ml-agents/config/ppo/Huggy.yaml`
+
+
+Weโre now ready to train our agent ๐ฅ.
+
+## Train our agent
+
+To train our agent, we just need to **launch mlagents-learn and select the executable containing the environment.**
+
+
+
+We define four parameters:
+
+1. `mlagents-learn `: the path where the hyperparameter config file is.
+2. `--env`: where the environment executable is.
+3. `--run_id`: the name you want to give to your training run id.
+4. `--no-graphics`: to not launch the visualization during the training.
+
+Train the model and use the `--resume` flag to continue training in case of interruption.
+
+> It will fail first time when you use `--resume`, try running the block again to bypass the error.
+
+
+
+The training will take 30 to 45min depending on your machine, go take a โ๏ธyou deserve it ๐ค.
+
+```python
+!mlagents-learn ./config/ppo/Huggy.yaml --env=./trained-envs-executables/linux/Huggy/Huggy --run-id="Huggy" --no-graphics
+```
+
+## Push the agent to the ๐ค Hub
+
+- Now that we trained our agent, weโre **ready to push it to the Hub to be able to play with Huggy on your browser๐ฅ.**
+
+To be able to share your model with the community there are three more steps to follow:
+
+1๏ธโฃ (If it's not already done) create an account to HF โก https://huggingface.co/join
+
+2๏ธโฃ Sign in and then, you need to store your authentication token from the Hugging Face website.
+- Create a new token (https://huggingface.co/settings/tokens) **with write role**
+
+
+
+- Copy the token
+- Run the cell below and paste the token
+
+```python
+from huggingface_hub import notebook_login
+
+notebook_login()
+```
+
+If you don't want to use a Google Colab or a Jupyter Notebook, you need to use this command instead: `huggingface-cli login`
+
+Then, we simply need to run `mlagents-push-to-hf`.
+
+
+
+And we define 4 parameters:
+
+1. `--run-id`: the name of the training run id.
+2. `--local-dir`: where the agent was saved, itโs results/, so in my case results/First Training.
+3. `--repo-id`: the name of the Hugging Face repo you want to create or update. Itโs always /
+If the repo does not exist **it will be created automatically**
+4. `--commit-message`: since HF repos are git repository you need to define a commit message.
+
+```python
+!mlagents-push-to-hf --run-id="HuggyTraining" --local-dir="./results/Huggy" --repo-id="ThomasSimonini/ppo-Huggy" --commit-message="Huggy"
+```
+
+Else, if everything worked you should have this at the end of the process(but with a different url ๐) :
+
+
+
+```
+Your model is pushed to the hub. You can view your model here: https://huggingface.co/ThomasSimonini/ppo-Huggy
+```
+
+Itโs the link to your model, it contains a model card that explains how to use it, your Tensorboard and your config file. **Whatโs awesome is that itโs a git repository, that means you can have different commits, update your repository with a new push etc.**
+
+
+
+But now comes the best: **being able to play with Huggy online ๐.**
+
+## Play with your Huggy ๐
+
+For this step itโs simple:
+
+- Open the game Huggy in your browser: https://huggingface.co/spaces/ThomasSimonini/Huggy
+
+- Click on Play with my Huggy model
+
+
+
+1. In step 1, choose your model repository which is the model id (in my case ThomasSimonini/ppo-Huggy).
+
+2. In step 2, **choose what model you want to replay**:
+ - I have multiple one, since we saved a model every 500000 timesteps.
+ - But if I want the more recent I choose Huggy.onnx
+
+๐ Whatโs nice **is to try with different models step to see the improvement of the agent.**
+
+Congrats on finishing this bonus unit!
+
+You can now sit and enjoy playing with your Huggy ๐ถ. And don't **forget to spread the love by sharing Huggy with your friends ๐ค**. And if you share about it on social media, **please tag us @huggingface and me @simoninithomas**
+
+
+
+
+## Keep Learning, Stay awesome ๐ค
\ No newline at end of file
diff --git a/notebooks/unit1/unit1.mdx b/notebooks/unit1/unit1.mdx
deleted file mode 100644
index 341a95f..0000000
--- a/notebooks/unit1/unit1.mdx
+++ /dev/null
@@ -1,617 +0,0 @@
-# Unit 1: Train your first Deep Reinforcement Learning Agent ๐ค
-
-
-In this notebook, you'll train your **first Deep Reinforcement Learning agent** a Lunar Lander agent that will learn to **land correctly on the Moon ๐**. Using [Stable-Baselines3](https://stable-baselines3.readthedocs.io/en/master/) a Deep Reinforcement Learning library, share them with the community, and experiment with different configurations
-
-โฌ๏ธ Here is an example of what **you will achieve in just a couple of minutes.** โฌ๏ธ
-
-
-
-
-```python
-%%html
-
-```
-
-### The environment ๐ฎ
-- [LunarLander-v2](https://www.gymlibrary.dev/environments/box2d/lunar_lander/)
-
-### The library used ๐
-- [Stable-Baselines3](https://stable-baselines3.readthedocs.io/en/master/)
-
-We're constantly trying to improve our tutorials, so **if you find some issues in this notebook**, please [open an issue on the Github Repo](https://github.com/huggingface/deep-rl-class/issues).
-
-## Objectives of this notebook ๐
-At the end of the notebook, you will:
-- Be able to use **Gym**, the environment library.
-- Be able to use **Stable-Baselines3**, the deep reinforcement learning library.
-- Be able to **push your trained agent to the Hub** with a nice video replay and an evaluation score ๐ฅ.
-
-
-
-
-## This notebook is from Deep Reinforcement Learning Course
-
-
-In this free course, you will:
-
-- ๐ Study Deep Reinforcement Learning in **theory and practice**.
-- ๐งโ๐ป Learn to **use famous Deep RL libraries** such as Stable Baselines3, RL Baselines3 Zoo, CleanRL and Sample Factory 2.0.
-- ๐ค Train **agents in unique environments**
-
-And more check ๐ the syllabus ๐ https://simoninithomas.github.io/deep-rl-course
-
-Donโt forget to **sign up to the course** (we are collecting your email to be able toย **send you the links when each Unit is published and give you information about the challenges and updates).**
-
-
-The best way to keep in touch and ask questions is to join our discord server to exchange with the community and with us ๐๐ป https://discord.gg/ydHrjt3WP5
-
-## Prerequisites ๐๏ธ
-Before diving into the notebook, you need to:
-
-๐ฒ ๐ **Done Unit 0** that gives you all the **information about the course and help you to onboard** ๐ค ADD LINK
-
-๐ฒ ๐ **Develop an understanding of the foundations of Reinforcement learning** (MC, TD, Rewards hypothesis...) by doing Unit 1 ๐ ADD LINK
-
-## A small recap of what is Deep Reinforcement Learning ๐
-
-
-Let's do a small recap on what we learned in the first Unit:
-- Reinforcement Learning is a **computational approach to learning from action**. We build an agent that learns from the environment by **interacting with it through trial and error** and receiving rewards (negative or positive) as feedback.
-
-- The goal of any RL agent is to **maximize its expected cumulative reward** (also called expected return) because RL is based on the _reward hypothesis_, which is that all goals can be described as the maximization of the expected cumulative reward.
-
-- The RL process is a **loop that outputs a sequence of state, action, reward, and next state**.
-
-- To calculate the expected cumulative reward (expected return), **we discount the rewards**: the rewards that come sooner (at the beginning of the game) are more probable to happen since they are more predictable than the long-term future reward.
-
-- To solve an RL problem, you want to **find an optimal policy**; the policy is the "brain" of your AI that will tell us what action to take given a state. The optimal one is the one that gives you the actions that max the expected return.
-
-
-There are **two** ways to find your optimal policy:
-- By **training your policy directly**: policy-based methods.
-- By **training a value function** that tells us the expected return the agent will get at each state and use this function to define our policy: value-based methods.
-
-- Finally, we spoke about Deep RL because **we introduce deep neural networks to estimate the action to take (policy-based) or to estimate the value of a state (value-based) hence the name "deep."**
-
-# Let's train our first Deep Reinforcement Learning agent and upload it to the Hub ๐
-
-
-## Set the GPU ๐ช
-- To **accelerate the agent's training, we'll use a GPU**. To do that, go to `Runtime > Change Runtime type`
-
-
-
-- `Hardware Accelerator > GPU`
-
-
-
-## Install dependencies and create a virtual screen ๐ฝ
-The first step is to install the dependencies, weโll install multiple ones.
-
-- `gym[box2D]`: Contains the LunarLander-v2 environment ๐ (we use `gym==0.21`)
-- `stable-baselines3[extra]`: The deep reinforcement learning library.
-- `huggingface_sb3`: Additional code for Stable-baselines3 to load and upload models from the Hugging Face ๐ค Hub.
-
-To make things easier, we created a script to install all these dependencies.
-
-```python
-!apt install swig cmake
-```
-
-TODO CHANGE LINK OF THE REQUIREMENTS
-
-```python
-!pip install -r https://huggingface.co/spaces/ThomasSimonini/temp-space-requirements/raw/main/requirements/requirements-unit1.txt
-```
-
-During the notebook, we'll need to generate a replay video. To do so, with colab, **we need to have a virtual screen to be able to render the environment** (and thus record the frames).
-
-Hence the following cell will install virtual screen libraries and create and run a virtual screen ๐ฅ
-
-```python
-!sudo apt-get update
-!apt install python-opengl
-!apt install ffmpeg
-!apt install xvfb
-!pip3 install pyvirtualdisplay
-```
-
-```python
-# Virtual display
-from pyvirtualdisplay import Display
-
-virtual_display = Display(visible=0, size=(1400, 900))
-virtual_display.start()
-```
-
-## Import the packages ๐ฆ
-
-One additional library we import is huggingface_hub **to be able to upload and download trained models from the hub**.
-
-
-The Hugging Face Hub ๐ค works as a central place where anyone can share and explore models and datasets. It has versioning, metrics, visualizations and other features that will allow you to easily collaborate with others.
-
-You can see here all the Deep reinforcement Learning models available ๐ https://huggingface.co/models?pipeline_tag=reinforcement-learning&sort=downloads
-
-
-
-```python
-import gym
-
-from huggingface_sb3 import load_from_hub, package_to_hub, push_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.evaluation import evaluate_policy
-from stable_baselines3.common.env_util import make_vec_env
-```
-
-## Understand what is Gym and how it works ๐ค
-
-๐ The library containing our environment is called Gym.
-**You'll use Gym a lot in Deep Reinforcement Learning.**
-
-The Gym library provides two things:
-- An interface that allows you to **create RL environments**.
-- A **collection of environments** (gym-control, atari, box2D...).
-
-Let's look at an example, but first let's remember what's the RL Loop.
-
-
-
-At each step:
-- Our Agent receivesย **state S0**ย from theย **Environment**ย โ we receive the first frame of our game (Environment).
-- Based on thatย **state S0,**ย the Agent takesย **action A0**ย โ our Agent will move to the right.
-- Environment to aย **new**ย **state S1**ย โ new frame.
-- The environment gives someย **reward R1**ย to the Agent โ weโre not deadย *(Positive Reward +1)*.
-
-
-With Gym:
-
-1๏ธโฃ We create our environment using `gym.make()`
-
-2๏ธโฃ We reset the environment to its initial state with `observation = env.reset()`
-
-At each step:
-
-3๏ธโฃ Get an action using our model (in our example we take a random action)
-
-4๏ธโฃ Using `env.step(action)`, we perform this action in the environment and get
-- `observation`: The new state (st+1)
-- `reward`: The reward we get after executing the action
-- `done`: Indicates if the episode terminated
-- `info`: A dictionary that provides additional information (depends on the environment).
-
-If the episode is done:
-- We reset the environment to its initial state with `observation = env.reset()`
-
-**Let's look at an example!** Make sure to read the code
-
-
-```python
-import gym
-
-# First, we create our environment called LunarLander-v2
-env = gym.make("LunarLander-v2")
-
-# Then we reset this environment
-observation = 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, done and info
- observation, reward, done, info = env.step(action)
-
- # If the game is done (in our case we land, crashed or timeout)
- if done:
- # Reset the environment
- print("Environment is reset")
- observation = env.reset()
-```
-
-## Create the LunarLander environment ๐ and understand how it works
-### [The environment ๐ฎ](https://www.gymlibrary.dev/environments/box2d/lunar_lander/)
-In this first tutorial, weโre going to train our agent, a [Lunar Lander](https://www.gymlibrary.dev/environments/box2d/lunar_lander/), **to land correctly on the moon**. To do that, the agent needs to learn **to adapt its speed and position(horizontal, vertical, and angular) to land correctly.**
-
-
----
-
-
-๐ก A good habit when you start to use an environment is to check its documentation
-
-๐ https://www.gymlibrary.dev/environments/box2d/lunar_lander/
-
----
-
-
-Let's see what the Environment looks like:
-
-
-```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
-```
-
-We see with `Observation Space Shape (8,)` that the observation is a vector of size 8, where each value contains different information about the lander:
-- Horizontal pad coordinate (x)
-- Vertical pad coordinate (y)
-- Horizontal speed (x)
-- Vertical speed (y)
-- Angle
-- Angular speed
-- If the left leg has contact point touched the land
-- If the right leg has contact point touched the land
-
-
-```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
-```
-
-The action space (the set of possible actions the agent can take) is discrete with 4 actions available ๐ฎ:
-
-- Do nothing,
-- Fire left orientation engine,
-- Fire the main engine,
-- Fire right orientation engine.
-
-Reward function (the function that will gives a reward at each timestep) ๐ฐ:
-
-- Moving from the top of the screen to the landing pad and zero speed is about 100~140 points.
-- Firing main engine is -0.3 each frame
-- Each leg ground contact is +10 points
-- Episode finishes if the lander crashes (additional - 100 points) or come to rest (+100 points)
-
-#### Vectorized Environment
-- We create a vectorized environment (method for stacking multiple independent environments into a single environment) of 16 environments, this way, **we'll have more diverse experiences during the training.**
-
-```python
-# Create the environment
-env = make_vec_env("LunarLander-v2", n_envs=16)
-```
-
-## Create the Model ๐ค
-- Now that we studied our environment and we understood the problem: **being able to land correctly the Lunar Lander to the Landing Pad by controlling left, right and main orientation engine**. Let's build the algorithm we're going to use to solve this Problem ๐.
-
-- To do so, we're going to use our first Deep RL library, [Stable Baselines3 (SB3)](https://stable-baselines3.readthedocs.io/en/master/).
-
-- SB3 is a set of **reliable implementations of reinforcement learning algorithms in PyTorch**.
-
----
-
-๐ก A good habit when using a new library is to dive first on the documentation: https://stable-baselines3.readthedocs.io/en/master/ and then try some tutorials.
-
-----
-
-
-
-To solve this problem, we're going to use SB3 **PPO**. [PPO (aka Proximal Policy Optimization) is one of the 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 is a combination of:
-- *Value-based reinforcement learning method*: learning an action-value function that will tell us what's the **most valuable action to take given a state and action**.
-- *Policy-based reinforcement learning method*: learning a policy that will **gives us a probability distribution over actions**.
-
-
-Stable-Baselines3 is easy to set up:
-
-1๏ธโฃ You **create your environment** (in our case it was done above)
-
-2๏ธโฃ You define the **model you want to use and instantiate this model** `model = PPO("MlpPolicy")`
-
-3๏ธโฃ You **train the agent** with `model.learn` and define the number of training timesteps
-
-```
-# 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,
-)
-```
-
-## Train the PPO agent ๐
-- Let's train our agent for 1,000,000 timesteps, don't forget to use GPU on Colab. It will take approximately ~20min, but you can use less timesteps if you just want to try it out.
-- During the training, take a โ break you deserved it ๐ค
-
-```python
-# TODO: Train it for 1,000,000 timesteps
-
-# TODO: Specify file name for model and save the model to file
-model_name = ""
-```
-
-#### 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)
-```
-
-## Evaluate the agent ๐
-- Now that our Lunar Lander agent is trained ๐, we need to **check its performance**.
-- Stable-Baselines3 provides a method to do that: `evaluate_policy`.
-- To fill that part you need to [check the documentation](https://stable-baselines3.readthedocs.io/en/master/guide/examples.html#basic-usage-training-saving-loading)
-- In the next step, we'll see **how to automatically evaluate and share your agent to compete in a leaderboard, but for now let's do it ourselves**
-
-
-๐ก When you evaluate your agent, you should not use your training environment but create an evaluation environment.
-
-```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 = 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}")
-```
-
-- In my case, I got a mean reward is `200.20 +/- 20.80` after training for 1 million steps, which means that our lunar lander agent is ready to land on the moon ๐๐ฅณ.
-
-## Publish our trained model on the Hub ๐ฅ
-Now that we saw we got good results after the training, we can publish our trained model on the hub ๐ค with one line of code.
-
-๐ The libraries documentation ๐ https://github.com/huggingface/huggingface_sb3/tree/main#hugging-face--x-stable-baselines3-v20
-
-Here's an example of a Model Card (with Space Invaders):
-
-By using `package_to_hub` **you evaluate, record a replay, generate a model card of your agent and push it to the hub**.
-
-This way:
-- You can **showcase our work** ๐ฅ
-- You can **visualize your agent playing** ๐
-- You can **share with the community an agent that others can use** ๐พ
-- You can **access a leaderboard ๐ to see how well your agent is performing compared to your classmates** ๐ https://huggingface.co/spaces/huggingface-projects/Deep-Reinforcement-Learning-Leaderboard
-
-
-To be able to share your model with the community there are three more steps to follow:
-
-1๏ธโฃ (If it's not already done) create an account to HF โก https://huggingface.co/join
-
-2๏ธโฃ Sign in and then, you need to store your authentication token from the Hugging Face website.
-- Create a new token (https://huggingface.co/settings/tokens) **with write role**
-
-
-
-- Copy the token
-- Run the cell below and paste the token
-
-```python
-notebook_login()
-!git config --global credential.helper store
-```
-
-If you don't want to use a Google Colab or a Jupyter Notebook, you need to use this command instead: `huggingface-cli login`
-
-3๏ธโฃ We're now ready to push our trained agent to the ๐ค Hub ๐ฅ using `package_to_hub()` function
-
-Let's fill the `package_to_hub` function:
-- `model`: our trained model.
-- `model_name`: the name of the trained model that we defined in `model_save`
-- `model_architecture`: the model architecture we used: in our case PPO
-- `env_id`: the name of the environment, in our case `LunarLander-v2`
-- `eval_env`: the evaluation environment defined in eval_env
-- `repo_id`: the name of the Hugging Face Hub Repository that will be created/updated `(repo_id = {username}/{repo_name})`
-
-๐ก **A good name is {username}/{model_architecture}-{env_id}**
-
-- `commit_message`: message of the commit
-
-```python
-import 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: Define a repo_id
-## repo_id is the id of the model repository from the Hugging Face Hub (repo_id = {organization}/{repo_name} for instance ThomasSimonini/ppo-LunarLander-v2
-repo_id =
-
-# TODO: Define the name of the environment
-env_id =
-
-# Create the evaluation env
-eval_env = DummyVecEnv([lambda: gym.make(env_id)])
-
-
-# TODO: Define the model architecture we used
-model_architecture = ""
-
-## TODO: Define the commit message
-commit_message = ""
-
-# method save, evaluate, generate a model card and record a replay video of your agent before pushing the repo to the hub
-package_to_hub(model=model, # Our trained model
- model_name=model_name, # The name of our trained model
- model_architecture=model_architecture, # The model architecture we used: in our case PPO
- env_id=env_id, # Name of the environment
- eval_env=eval_env, # Evaluation Environment
- repo_id=repo_id, # id of the model repository from the Hugging Face Hub (repo_id = {organization}/{repo_name} for instance ThomasSimonini/ppo-LunarLander-v2
- commit_message=commit_message)
-
-# Note: if after running the package_to_hub function and it gives an issue of rebasing, please run the following code
-# cd && git add . && git commit -m "Add message" && git pull
-# And don't forget to do a "git push" at the end to push the change to the hub.
-```
-
-#### Solution
-
-
-```python
-import 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
-
-# PLACE the variables you've just defined two cells above
-# Define the name of the environment
-env_id = "LunarLander-v2"
-
-# TODO: Define the model architecture we used
-model_architecture = "PPO"
-
-## Define a repo_id
-## repo_id is the id of the model repository from the Hugging Face Hub (repo_id = {organization}/{repo_name} for instance ThomasSimonini/ppo-LunarLander-v2
-## CHANGE WITH YOUR REPO ID
-repo_id = "ThomasSimonini/ppo-LunarLander-v2" # Change with your repo id, you can't push with mine ๐
-
-## Define the commit message
-commit_message = "Upload PPO LunarLander-v2 trained agent"
-
-# Create the evaluation env
-eval_env = DummyVecEnv([lambda: gym.make(env_id)])
-
-# PLACE the package_to_hub function you've just filled here
-package_to_hub(
- model=model, # Our trained model
- model_name=model_name, # The name of our trained model
- model_architecture=model_architecture, # The model architecture we used: in our case PPO
- env_id=env_id, # Name of the environment
- eval_env=eval_env, # Evaluation Environment
- repo_id=repo_id, # id of the model repository from the Hugging Face Hub (repo_id = {organization}/{repo_name} for instance ThomasSimonini/ppo-LunarLander-v2
- commit_message=commit_message,
-)
-```
-
-Congrats ๐ฅณ you've just trained and uploaded your first Deep Reinforcement Learning agent. The script above should have displayed a link to a model repository such as https://huggingface.co/osanseviero/test_sb3. When you go to this link, you can:
-* see a video preview of your agent at the right.
-* click "Files and versions" to see all the files in the repository.
-* click "Use in stable-baselines3" to get a code snippet that shows how to load the model.
-* a model card (`README.md` file) which gives a description of the model
-
-Under the hood, the Hub uses git-based repositories (don't worry if you don't know what git is), which means you can update the model with new versions as you experiment and improve your agent.
-
-Compare the results of your LunarLander-v2 with your classmates using the leaderboard ๐ ๐ https://huggingface.co/spaces/huggingface-projects/Deep-Reinforcement-Learning-Leaderboard
-
-## Load a saved LunarLander model from the Hub ๐ค
-Thanks to [ironbar](https://github.com/ironbar) for the contribution.
-
-Loading a saved model from the Hub is really easy.
-
-You go https://huggingface.co/models?library=stable-baselines3 to see the list of all the Stable-baselines3 saved models.
-1. You select one and copy its repo_id
-
-
-
-2. Then we just need to use load_from_hub with:
-- The repo_id
-- The filename: the saved model inside the repo and its extension (*.zip)
-
-```python
-from huggingface_sb3 import load_from_hub
-
-repo_id = "Classroom-workshop/assignment2-omar" # The repo_id
-filename = "ppo-LunarLander-v2.zip" # The model filename.zip
-
-# When the model was trained on Python 3.8 the pickle protocol is 5
-# But Python 3.6, 3.7 use protocol 4
-# In order to get compatibility we need to:
-# 1. Install pickle5 (we done it at the beginning of the colab)
-# 2. Create a custom empty object we pass as parameter to 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)
-```
-
-Let's evaluate this agent:
-
-```python
-# @title
-eval_env = 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}")
-```
-
-## Some additional challenges ๐
-The best way to learn **is to try things by your own**! As you saw, the current agent is not doing great. As a first suggestion, you can train for more steps. With 1,000,000 steps, we saw some great results!
-
-In the [Leaderboard](https://huggingface.co/spaces/huggingface-projects/Deep-Reinforcement-Learning-Leaderboard) you will find your agents. Can you get to the top?
-
-Here are some ideas to achieve so:
-* Train more steps
-* Try different hyperparameters of `PPO`. You can see them at https://stable-baselines3.readthedocs.io/en/master/modules/ppo.html#parameters.
-* Check the [Stable-Baselines3 documentation](https://stable-baselines3.readthedocs.io/en/master/modules/dqn.html) and try another models such as DQN.
-* **Push your new trained model** on the Hub ๐ฅ
-
-**Compare the results of your LunarLander-v2 with your classmates** using the [leaderboard](https://huggingface.co/spaces/huggingface-projects/Deep-Reinforcement-Learning-Leaderboard) ๐
-
-Is moon landing too boring to you? Try to **change the environment**, why not using MountainCar-v0, CartPole-v1 or CarRacing-v0? Check how they works [using the gym documentation](https://www.gymlibrary.dev/) and have fun ๐.
-
-________________________________________________________________________
-Congrats on finishing this chapter! That was the biggest one, **and there was a lot of information.**
-
-If youโre still feel confused with all these elements...it's totally normal! **This was the same for me and for all people who studied RL.**
-
-Take time to really **grasp the material before continuing and try the additional challenges**. Itโs important to master these elements and having a solid foundations.
-
-Naturally, during the course, weโre going to use and deeper explain again these terms but **itโs better to have a good understanding of them now before diving into the next chapters.**
-
-
-Next time, in the bonus unit 1, you'll train Huggy the Dog to fetch the stick.
-
-
-
-## Keep learning, stay awesome ๐ค
\ No newline at end of file
diff --git a/units/en/_toctree.yml b/units/en/_toctree.yml
index 0a17670..2429cbb 100644
--- a/units/en/_toctree.yml
+++ b/units/en/_toctree.yml
@@ -38,8 +38,10 @@
title: Introduction
- local: unitbonus1/how-huggy-works
title: How Huggy works?
- - local: unitbonus1/train-play
- title: Train and play with Huggy
+ - local: unitbonus1/train
+ title: Train Huggy
+ - local: unitbonus1/play
+ title: Play with Huggy
- local: unitbonus1/conclusion
title: Conclusion
- title: Unit 2. Introduction to Q-Learning
diff --git a/units/en/unitbonus1/train-play.mdx b/units/en/unitbonus1/play.mdx
similarity index 76%
rename from units/en/unitbonus1/train-play.mdx
rename to units/en/unitbonus1/play.mdx
index 21cf139..f2154cc 100644
--- a/units/en/unitbonus1/train-play.mdx
+++ b/units/en/unitbonus1/play.mdx
@@ -1,13 +1,4 @@
-# Let's train and play with Huggy ๐ถ [[train-play]]
-
-## Let's train Huggy ๐ถ
-
-**To start to train Huggy, click on Open In Colab button** ๐ :
-
-[]()
-
-
-## Play with Huggy
+# Play with Huggy [[play]]
Now that you've trained Huggy and pushed it to the Hub. **You will be able to play with him โค๏ธ**
diff --git a/units/en/unitbonus1/train.mdx b/units/en/unitbonus1/train.mdx
new file mode 100644
index 0000000..e8fe982
--- /dev/null
+++ b/units/en/unitbonus1/train.mdx
@@ -0,0 +1,265 @@
+# Let's train and play with Huggy ๐ถ [[train-play]]
+
+## Let's train Huggy ๐ถ
+
+**To start to train Huggy, click on Open In Colab button** ๐ :
+
+[]()
+
+
+# Bonus Unit 1: Let's train Huggy the Dog ๐ถ to fetch a stick
+
+
+
+In this notebook, we'll reinforce what we learn in the first Unit by **teaching Huggy the Dog to fetch the stick and then play with it directly in your browser**
+
+โฌ๏ธ Here is an example of what **you will achieve at the end of the unit.** โฌ๏ธ (launch โถ to see)
+
+```python
+%%html
+
+```
+
+### The environment ๐ฎ
+
+- Huggy the Dog, an environment created by [Thomas Simonini](https://twitter.com/ThomasSimonini) based on [Puppo The Corgi](https://blog.unity.com/technology/puppo-the-corgi-cuteness-overload-with-the-unity-ml-agents-toolkit)
+
+### The library used ๐
+
+- [MLAgents (Hugging Face version)](https://github.com/huggingface/ml-agents)
+
+We're constantly trying to improve our tutorials, so **if you find some issues in this notebook**, please [open an issue on the Github Repo](https://github.com/huggingface/deep-rl-class/issues).
+
+## Objectives of this notebook ๐
+
+At the end of the notebook, you will:
+
+- Understand **the state space, action space and reward function used to train Huggy**.
+- **Train your own Huggy** to fetch the stick.
+- Be able to play **with your trained Huggy directly in your browser**.
+
+
+
+
+## This notebook is from Deep Reinforcement Learning Course
+
+
+In this free course, you will:
+
+- ๐ Study Deep Reinforcement Learning in **theory and practice**.
+- ๐งโ๐ป Learn to **use famous Deep RL libraries** such as Stable Baselines3, RL Baselines3 Zoo, CleanRL and Sample Factory 2.0.
+- ๐ค Train **agents in unique environments**
+
+And more check ๐ the syllabus ๐ https://simoninithomas.github.io/deep-rl-course
+
+Donโt forget to **sign up to the course** (we are collecting your email to be able toย **send you the links when each Unit is published and give you information about the challenges and updates).**
+
+
+The best way to keep in touch is to join our discord server to exchange with the community and with us ๐๐ป https://discord.gg/ydHrjt3WP5
+
+## Prerequisites ๐๏ธ
+
+Before diving into the notebook, you need to:
+
+๐ฒ ๐ **Develop an understanding of the foundations of Reinforcement learning** (MC, TD, Rewards hypothesis...) by doing Unit 1
+
+๐ฒ ๐ **Read the introduction to Huggy** by doing Bonus Unit 1
+
+## Clone the repository and install the dependencies ๐ฝ
+
+- We need to clone the repository, that **contains the experimental version of the library that allows you to push your trained agent to the Hub.**
+
+```python
+%%capture
+# Clone this specific repository (can take 3min)
+!git clone https://github.com/huggingface/ml-agents/
+```
+
+```python
+%%capture
+# Go inside the repository and install the package (can take 3min)
+%cd ml-agents
+!pip3 install -e ./ml-agents-envs
+!pip3 install -e ./ml-agents
+```
+
+## Download and move the environment zip file in `./trained-envs-executables/linux/`
+
+- Our environment executable is in a zip file.
+- We need to download it and place it to `./trained-envs-executables/linux/`
+
+```python
+!mkdir ./trained-envs-executables
+!mkdir ./trained-envs-executables/linux
+```
+
+```python
+!wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=1zv3M95ZJTWHUVOWT6ckq_cm98nft8gdF' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=1zv3M95ZJTWHUVOWT6ckq_cm98nft8gdF" -O ./trained-envs-executables/linux/Huggy.zip && rm -rf /tmp/cookies.txt
+```
+
+Download the file Huggy.zip from https://drive.google.com/uc?export=download&id=1zv3M95ZJTWHUVOWT6ckq_cm98nft8gdF using `wget`. Check out the full solution to download large files from GDrive [here](https://bcrf.biochem.wisc.edu/2021/02/05/download-google-drive-files-using-wget/)
+
+```python
+%%capture
+!unzip -d ./trained-envs-executables/linux/ ./trained-envs-executables/linux/Huggy.zip
+```
+
+Make sure your file is accessible
+
+```python
+!chmod -R 755 ./trained-envs-executables/linux/Huggy
+```
+
+## Let's recap how this environment works
+
+### The State Space: what Huggy "perceives."
+
+Huggy doesn't "see" his environment. Instead, we provide him information about the environment:
+
+- The target (stick) position
+- The relative position between himself and the target
+- The orientation of his legs.
+
+Given all this information, Huggy **can decide which action to take next to fulfill his goal**.
+
+
+
+
+### The Action Space: what moves Huggy can do
+
+
+**Joint motors drive huggy legs**. It means that to get the target, Huggy needs to **learn to rotate the joint motors of each of his legs correctly so he can move**.
+
+### The Reward Function
+
+The reward function is designed so that **Huggy will fulfill his goal** : fetch the stick.
+
+Remember that one of the foundations of Reinforcement Learning is the *reward hypothesis*: a goal can be described as the **maximization of the expected cumulative reward**.
+
+Here, our goal is that Huggy **goes towards the stick but without spinning too much**. Hence, our reward function must translate this goal.
+
+Our reward function:
+
+
+
+- *Orientation bonus*: we **reward him for getting close to the target**.
+- *Time penalty*: a fixed-time penalty given at every action to **force him to get to the stick as fast as possible**.
+- *Rotation penalty*: we penalize Huggy if **he spins too much and turns too quickly**.
+- *Getting to the target reward*: we reward Huggy for **reaching the target**.
+
+## Check the Huggy config file
+
+- In ML-Agents, you define the **training hyperparameters into config.yaml files.**
+
+- For the scope of this notebook, we're not going to modify the hyperparameters but if you want to try as an experimentation, you should also try to modify some other hyperparameters, Unity provides a very [good documentation explaining each of them here](https://github.com/Unity-Technologies/ml-agents/blob/main/docs/Training-Configuration-File.md).
+
+- Click here to open the config.yaml: `/content/ml-agents/config/ppo/Huggy.yaml`
+
+
+Weโre now ready to train our agent ๐ฅ.
+
+## Train our agent
+
+To train our agent, we just need to **launch mlagents-learn and select the executable containing the environment.**
+
+
+
+We define four parameters:
+
+1. `mlagents-learn `: the path where the hyperparameter config file is.
+2. `--env`: where the environment executable is.
+3. `--run_id`: the name you want to give to your training run id.
+4. `--no-graphics`: to not launch the visualization during the training.
+
+Train the model and use the `--resume` flag to continue training in case of interruption.
+
+> It will fail first time when you use `--resume`, try running the block again to bypass the error.
+
+
+
+The training will take 30 to 45min depending on your machine, go take a โ๏ธyou deserve it ๐ค.
+
+```python
+!mlagents-learn ./config/ppo/Huggy.yaml --env=./trained-envs-executables/linux/Huggy/Huggy --run-id="Huggy" --no-graphics
+```
+
+## Push the agent to the ๐ค Hub
+
+- Now that we trained our agent, weโre **ready to push it to the Hub to be able to play with Huggy on your browser๐ฅ.**
+
+To be able to share your model with the community there are three more steps to follow:
+
+1๏ธโฃ (If it's not already done) create an account to HF โก https://huggingface.co/join
+
+2๏ธโฃ Sign in and then, you need to store your authentication token from the Hugging Face website.
+- Create a new token (https://huggingface.co/settings/tokens) **with write role**
+
+
+
+- Copy the token
+- Run the cell below and paste the token
+
+```python
+from huggingface_hub import notebook_login
+
+notebook_login()
+```
+
+If you don't want to use a Google Colab or a Jupyter Notebook, you need to use this command instead: `huggingface-cli login`
+
+Then, we simply need to run `mlagents-push-to-hf`.
+
+
+
+And we define 4 parameters:
+
+1. `--run-id`: the name of the training run id.
+2. `--local-dir`: where the agent was saved, itโs results/, so in my case results/First Training.
+3. `--repo-id`: the name of the Hugging Face repo you want to create or update. Itโs always /
+If the repo does not exist **it will be created automatically**
+4. `--commit-message`: since HF repos are git repository you need to define a commit message.
+
+```python
+!mlagents-push-to-hf --run-id="HuggyTraining" --local-dir="./results/Huggy" --repo-id="ThomasSimonini/ppo-Huggy" --commit-message="Huggy"
+```
+
+Else, if everything worked you should have this at the end of the process(but with a different url ๐) :
+
+
+
+```
+Your model is pushed to the hub. You can view your model here: https://huggingface.co/ThomasSimonini/ppo-Huggy
+```
+
+Itโs the link to your model, it contains a model card that explains how to use it, your Tensorboard and your config file. **Whatโs awesome is that itโs a git repository, that means you can have different commits, update your repository with a new push etc.**
+
+
+
+But now comes the best: **being able to play with Huggy online ๐.**
+
+## Play with your Huggy ๐
+
+For this step itโs simple:
+
+- Open the game Huggy in your browser: https://huggingface.co/spaces/ThomasSimonini/Huggy
+
+- Click on Play with my Huggy model
+
+
+
+1. In step 1, choose your model repository which is the model id (in my case ThomasSimonini/ppo-Huggy).
+
+2. In step 2, **choose what model you want to replay**:
+ - I have multiple one, since we saved a model every 500000 timesteps.
+ - But if I want the more recent I choose Huggy.onnx
+
+๐ Whatโs nice **is to try with different models step to see the improvement of the agent.**
+
+Congrats on finishing this bonus unit!
+
+You can now sit and enjoy playing with your Huggy ๐ถ. And don't **forget to spread the love by sharing Huggy with your friends ๐ค**. And if you share about it on social media, **please tag us @huggingface and me @simoninithomas**
+
+
+
+
+## Keep Learning, Stay awesome ๐ค