Reinforcement Learning
ml-agents
TensorBoard
ONNX
SnowballTarget
deep-reinforcement-learning
ML-Agents-SnowballTarget
Eval Results (legacy)
Instructions to use elliemci/ppo-Snowball-Target with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ml-agents
How to use elliemci/ppo-Snowball-Target with ml-agents:
mlagents-load-from-hf --repo-id="elliemci/ppo-Snowball-Target" --local-dir="./downloads"
- Notebooks
- Google Colab
- Kaggle
Model card: results with sources, training config, links
Browse files
README.md
CHANGED
|
@@ -5,31 +5,64 @@ tags:
|
|
| 5 |
- deep-reinforcement-learning
|
| 6 |
- reinforcement-learning
|
| 7 |
- ML-Agents-SnowballTarget
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
|
| 11 |
-
This is a trained model of a **ppo** agent playing **SnowballTarget**
|
| 12 |
-
using the [Unity ML-Agents Library](https://github.com/Unity-Technologies/ml-agents).
|
| 13 |
|
| 14 |
-
|
| 15 |
-
The Documentation: https://unity-technologies.github.io/ml-agents/ML-Agents-Toolkit-Documentation/
|
| 16 |
|
| 17 |
-
|
| 18 |
-
- A *short tutorial* where you teach Huggy the Dog 🐶 to fetch the stick and then play with him directly in your
|
| 19 |
-
browser: https://huggingface.co/learn/deep-rl-course/unitbonus1/introduction
|
| 20 |
-
- A *longer tutorial* to understand how works ML-Agents:
|
| 21 |
-
https://huggingface.co/learn/deep-rl-course/unit5/introduction
|
| 22 |
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
```
|
| 27 |
|
| 28 |
-
|
| 29 |
-
You can watch your agent **playing directly in your browser**
|
| 30 |
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
- deep-reinforcement-learning
|
| 6 |
- reinforcement-learning
|
| 7 |
- ML-Agents-SnowballTarget
|
| 8 |
+
model-index:
|
| 9 |
+
- name: PPO
|
| 10 |
+
results:
|
| 11 |
+
- task:
|
| 12 |
+
type: reinforcement-learning
|
| 13 |
+
name: reinforcement-learning
|
| 14 |
+
dataset:
|
| 15 |
+
name: SnowballTarget
|
| 16 |
+
type: SnowballTarget
|
| 17 |
+
metrics:
|
| 18 |
+
- type: mean_reward
|
| 19 |
+
value: 28.82
|
| 20 |
+
name: training mean reward at 3,999,976 steps
|
| 21 |
+
verified: false
|
| 22 |
---
|
| 23 |
|
| 24 |
+
# **PPO** agent playing **SnowballTarget**
|
|
|
|
|
|
|
| 25 |
|
| 26 |
+

|
|
|
|
| 27 |
|
| 28 |
+
*Course illustration, not my agent (image from the Hugging Face Deep RL Course).*
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
|
| 30 |
+
A [PPO](https://arxiv.org/abs/1707.06347) agent trained with the
|
| 31 |
+
[Unity ML-Agents](https://github.com/Unity-Technologies/ml-agents) toolkit on **SnowballTarget**, where the agent throws snowballs at
|
| 32 |
+
targets, as a [Unit 5](https://huggingface.co/learn/deep-rl-course/unit5/introduction) project of the Hugging Face Deep RL Course.
|
|
|
|
| 33 |
|
| 34 |
+
## Results
|
|
|
|
| 35 |
|
| 36 |
+
| | |
|
| 37 |
+
|---|---|
|
| 38 |
+
| Steps trained | 4,059,440 (the run stopped at 4.06M of `max_steps` 5M) |
|
| 39 |
+
| Mean reward at the final checkpoint | not recorded (`reward: null`) |
|
| 40 |
+
| Last recorded mean reward, at 3,999,976 steps | **28.82** |
|
| 41 |
+
|
| 42 |
+
Source: `run_logs/training_status.json`; `max_steps` from `configuration.yaml`. The reward is a training-time mean from the
|
| 43 |
+
stochastic policy, **not** a separate evaluation, and it belongs to an earlier checkpoint than the final model.
|
| 44 |
+
The run was resumed several times (7 TensorBoard event files in `SnowballTarget/`).
|
| 45 |
+
|
| 46 |
+
## Training
|
| 47 |
+
|
| 48 |
+
* Trainer `ppo`, behaviour `SnowballTarget`, run id `SnowballTarget1`, 1 environment. ML-Agents 1.2.0.dev0, PyTorch 2.2.2 (`run_logs/training_status.json` metadata).
|
| 49 |
+
* Hyperparameters: batch 128, buffer 2048, learning rate 1e-3 (linear), beta 5e-3, epsilon 0.2, lambda 0.95, 3 epochs,
|
| 50 |
+
network 2 x 256, gamma 0.99, time horizon 64.
|
| 51 |
+
* Full config: `configuration.yaml` in this repo. Notebook and notes:
|
| 52 |
+
[GitHub](https://github.com/elliemci/deep-rl/tree/main/units/unit5-ml-agents).
|
| 53 |
+
|
| 54 |
+
## Watch the agent play
|
| 55 |
+
|
| 56 |
+
The Hugging Face browser demo for this environment currently hangs on model search, so no replay is available.
|
| 57 |
+
|
| 58 |
+
## Download
|
| 59 |
+
|
| 60 |
+
```bash
|
| 61 |
+
mlagents-load-from-hf --repo-id="elliemci/ppo-Snowball-Target" --local-dir="./downloads"
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
## Resume training
|
| 65 |
+
|
| 66 |
+
```bash
|
| 67 |
+
mlagents-learn <your_configuration_file_path.yaml> --run-id=SnowballTarget1 --resume
|
| 68 |
+
```
|