YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
Bonus Unit 1: Train Huggy the Dog to Fetch a Stick
This project is based on Hugging Face Deep RL Course Bonus Unit 1, where you will train Huggy the Dog to fetch a stick using Unity ML-Agents. After training, you can play with your Huggy agent directly in your browser!
Project Structure
bonus_unit1.py: The main notebook/script containing step-by-step instructions, explanations, and code for training Huggy.train.py: A script to launch training using ML-Agents.requirements.txt: Python dependencies for running the training and pushing the model to Hugging Face Hub.
Steps to Run
Install Dependencies
pip install -r requirements.txtDownload the Huggy Environment Download
Huggy.zipfrom Huggy GitHub Repo and unzip it to./trained-envs-executables/linux/.Prepare the Config File Place your config YAML (e.g.,
Huggy.yaml) in the./config/ppo/directory. You can use the sample config from the course or adjust hyperparameters as needed.Train the Agent
python train.pyThis will run ML-Agents training with your config and environment.
Push to Hugging Face Hub (optional) After training, you can push your model to the Hugging Face Hub using
mlagents-push-to-hf.Play with Huggy Online Visit Huggy Space and load your trained model!
Key Concepts
- State Space: Huggy perceives the target position, relative position, and leg orientation.
- Action Space: Huggy controls his leg motors to move toward the stick.
- Reward Function: Rewards Huggy for reaching the stick, penalizes spinning and slow movement.
References
If you find issues or have suggestions, please open an issue!