File size: 6,483 Bytes
e473e72 fefd804 e58b618 7661322 e58b618 48031bb c57acf2 48031bb e58b618 64628c0 48031bb e473e72 df99359 e473e72 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 | ---
library_name: ml-agents
tags:
- SnowballTarget
- deep-reinforcement-learning
- reinforcement-learning
- ML-Agents-SnowballTarget
---
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Project Overview</title>
<style>
body {
font-family: Arial, sans-serif;
}
.container {
width: 80%;
margin: auto;
}
.section {
margin-bottom: 20px;
}
.section-title {
font-weight: bold;
font-size: 1.5em;
margin-bottom: 10px;
}
.section-content {
margin-left: 20px;
}
code {
background-color: #f8f8f8;
padding: 2px 8px;
border-radius: 4px;
font-family: "Courier New", Courier, monospace;
}
.tips {
font-style: italic;
}
.link {
color: blue;
text-decoration: none;
}
</style>
</head>
<body>
<div class="container">
<div class="section">
<div class="section-title">Project Overview:</div>
</div>
<div class="section">
<div class="section-title">The Challenging Bits:</div>
<div class="section-content">
<ul>
<li>The data preprocessing was intense. Making sure the data was clean and in the right format took some effort. If you're new to this, make sure you understand how to handle missing values and outliers.</li>
<li>Fine-tuning the model parameters was another tough part. It's a bit of an art to balance overfitting and underfitting. My tip? Start with a wide parameter search and then narrow it down.</li>
</ul>
</div>
</div>
<div class="section">
<div class="section-title">What Was Easier:</div>
<div class="section-content">
<ul>
<li>Once the data was prepped, feeding it into the model was pretty simple. The frameworks are user-friendly, so that part felt more like connecting the dots.</li>
<li>Writing the code for model evaluation was also pretty straightforward. Most libraries provide functions to generate metrics so that part felt more like following a recipe.</li>
</ul>
</div>
</div>
<div class="section">
<div class="section-title">Tips for the Code:</div>
<p class="tips">Take the time to really understand each line of code. It's tempting to just copy-paste from Stack Overflow or tutorials, but you'll learn more by typing it out and playing with it.</p>
<p class="tips">Don't ignore the error messages. They're actually really helpful once you learn how to decipher them. They can pinpoint exactly where and what your issue might be.</p>
</div>
<div class="section">
<div class="section-title">Looking at the Code:</div>
<p>The code is well-organized, which is great. The functions are modular, which means they do one thing and do it well. That makes debugging a whole lot easier. There's a mix of simple and complex functions, so if you're trying to understand the code, maybe start with the simpler utility functions and then work your way up to the model training and evaluation parts.</p>
<p>If you're just getting started with this codebase, I'd suggest running some small tests on each function to see what inputs they expect and what outputs they give.</p>
<p>Understanding these individual components will help you see the bigger picture of how the project works.</p>
<div class="section-title">Machine Learning with Unity's ML-Agents:</div>
<p>If you're embarking on a journey to understand and use machine learning within Unity using the ML-Agents Toolkit, below you'll find a collection of resources to get you started:</p>
<h2>Stack Overflow Resources</h2>
<ul>
<li>
General ML-Agents Questions: Find community discussions and solutions related to ML-Agents at <a href="https://stackoverflow.com/questions/tagged/ml-agents">https://stackoverflow.com/questions/tagged/ml-agents</a>.
</li>
<li>
Data Preprocessing Questions: Discover advice and strategies for data preprocessing in machine learning at <a href="https://stackoverflow.com/questions/tagged/data-preprocessing">https://stackoverflow.com/questions/tagged/data-preprocessing</a>.
</li>
<li>
Machine Learning Tips: Search for insights on machine learning techniques, including parameter tuning and model evaluation, at <a href="https://stackoverflow.com/questions/tagged/machine-learning">https://stackoverflow.com/questions/tagged/machine-learning</a>.
</li>
</ul>
<h2>GitHub Resources</h2>
<ul>
<li>
Unity ML-Agents Toolkit Repository: Access the official repository for the latest code, releases, and documentation at <a href="https://github.com/Unity-Technologies/ml-agents">https://github.com/Unity-Technologies/ml-agents</a>.
</li>
<li>
ML-Agents Wiki: Explore the wiki for tutorials, how-tos, and FAQs at <a href="https://github.com/Unity-Technologies/ml-agents/wiki">https://github.com/Unity-Technologies/ml-agents/wiki</a>.
</li>
<li>
Issue Tracker: Check if others have experienced similar issues and find solutions or workarounds at <a href="https://github.com/Unity-Technologies/ml-agents/issues">https://github.com/Unity-Technologies/ml-agents/issues</a>.
</li>
</ul>
</div>
</div>
# **ppo** Agent playing **SnowballTarget**
This is a trained model of a **ppo** agent playing **SnowballTarget**
using the [Unity ML-Agents Library](https://github.com/Unity-Technologies/ml-agents).
## Usage (with ML-Agents)
The Documentation: https://unity-technologies.github.io/ml-agents/ML-Agents-Toolkit-Documentation/
We wrote a complete tutorial to learn to train your first agent using ML-Agents and publish it to the Hub:
- A *short tutorial* where you teach Huggy the Dog 🐶 to fetch the stick and then play with him directly in your
browser: https://huggingface.co/learn/deep-rl-course/unitbonus1/introduction
- A *longer tutorial* to understand how works ML-Agents:
https://huggingface.co/learn/deep-rl-course/unit5/introduction
### Resume the training
```bash
mlagents-learn <your_configuration_file_path.yaml> --run-id=<run_id> --resume
```
### Watch your Agent play
You can watch your agent **playing directly in your browser**
1. If the environment is part of ML-Agents official environments, go to https://huggingface.co/spaces/ThomasSimonini/ML-Agents-SnowballTarget
2. Step 1: Find your model_id: Feebo37/ppo-SnowballTarget
3. Step 2: Select your *.nn /*.onnx file
4. Click on Watch the agent play 👀
|