|
| 1 | +# AMP Template Setup Guide |
| 2 | + |
| 3 | +## Overview |
| 4 | +This guide provides basic details on the AMP algorithm. Additionally, it provides step-by-step instructions for setting up and running the AI Scientist with the AMP template and DeepMimic integration. |
| 5 | + |
| 6 | +## What Is AMP? |
| 7 | +Adversarial Motion Priors ```(Peng et al., 2021)``` presents an unsupervised reinforcement learning approach to character animation based on learning from unstructured motion data to cast natural behaviors on simulated characters. |
| 8 | + |
| 9 | +Paper Website available here: |
| 10 | +``` |
| 11 | +https://xbpeng.github.io/projects/AMP/index.html |
| 12 | +``` |
| 13 | + |
| 14 | +The paper was released with the ```DeepMimic``` library as a framework for training AMP agents. This template for the AI-Scientist allows users to experiment with modifications to the base AMP algorithm within the DeepMimic library. |
| 15 | + |
| 16 | +```DeepMimic``` requires a somewhat complicated build process, so I wrote a bash script ```DeepMimic/auto_setup.sh``` that handles the entire setup process. |
| 17 | + |
| 18 | +The ```experiment.py``` file implements a simple training run on an AMP agent for 3 different motion files: |
| 19 | +``` |
| 20 | +"DeepMimic/data/motions/humanoid3d_walk.txt" |
| 21 | +"DeepMimic/data/motions/humanoid3d_jog.txt" |
| 22 | +"DeepMimic/data/motions/humanoid3d_run.txt" |
| 23 | +``` |
| 24 | + |
| 25 | +Anothe popular (and more recent) option for experimenting with AMP is through the [ProtoMotions](https://github.com/NVlabs/ProtoMotions) Library, which uses NVIDIA's IsaacGym as a backbone. For this reason, I decided to go with DeepMimic as a more light-weight alternative that still allows users to test and evaluate experimental conditions on the base AMP algorithm. |
| 26 | + |
| 27 | +Please follow the section below for specific setup instructions, and please see ```templates/amp/examples/``` for example paper generations. Note, that the Semantic Scholar API was not used for any of these generations, as I am on the waiting list for an API key. |
| 28 | + |
| 29 | +I generated the given example papers on a "fresh-out-the-box" A100 (40 GB SXM4) on Lambda Labs by followings the instructions as indicated in [Step-by-Step Setup Instructions](#setup-instructions). |
| 30 | + |
| 31 | +## Prerequisites |
| 32 | +Before beginning the setup process, ensure that you have Miniconda3 installed on your system at ```/home/ubuntu/miniconda3```. If it is not already installed, it will be handled by the ```DeepMimic/auto_setup.sh``` script automatically. This is important because this path is used for building the python wrapper of DeepMimic in |
| 33 | +```DeepMimic/DeepMimicCore/Makefile.auto```. |
| 34 | + |
| 35 | +<a id="setup-instructions"></a> |
| 36 | +## Step-by-Step Setup Instructions |
| 37 | + |
| 38 | + |
| 39 | +### Global Environment Setup |
| 40 | +```bash |
| 41 | +# Create and activate a new conda environment |
| 42 | +conda create -n ai_scientist python=3.11 |
| 43 | +conda activate ai_scientist |
| 44 | + |
| 45 | +# Install LaTeX dependencies |
| 46 | +sudo apt-get install texlive-full |
| 47 | + |
| 48 | +# Install required Python packages from AI-Scientist root |
| 49 | +pip install -r requirements.txt |
| 50 | +``` |
| 51 | + |
| 52 | +### DeepMimic Configuration |
| 53 | +```bash |
| 54 | +# Initialize and update the DeepMimic submodule |
| 55 | +git submodule update --init |
| 56 | + |
| 57 | +# Navigate to DeepMimic directory |
| 58 | +cd templates/amp/DeepMimic |
| 59 | + |
| 60 | +# Build the Python wrapper for DeepMimicCore |
| 61 | +bash auto_setup.sh |
| 62 | + |
| 63 | +# Make sure Conda was exported to PATH if installed through auto_setup.sh |
| 64 | +PATH ="/home/ubuntu/miniconda3:$PATH" |
| 65 | +echo 'export PATH="/home/ubuntu/miniconda3:$PATH"' >> ~/.bashrc |
| 66 | +source ~/.bashrc |
| 67 | +``` |
| 68 | + |
| 69 | + |
| 70 | +### Running Experiments |
| 71 | +```bash |
| 72 | +# Move to the AMP template directory |
| 73 | +cd ../ |
| 74 | + |
| 75 | +# Execute the experiment |
| 76 | +python experiment.py |
| 77 | + |
| 78 | +# Generate visualization plots |
| 79 | +python plot.py |
| 80 | +``` |
| 81 | + |
| 82 | +### Launching AI Scientist |
| 83 | +```bash |
| 84 | +# Go to AI-Scientist Root Directory |
| 85 | +cd ../../ |
| 86 | + |
| 87 | +# Ensure you're in the ai_scientist environment |
| 88 | +conda activate ai_scientist |
| 89 | + |
| 90 | +# Launch the AI Scientist with specified parameters |
| 91 | +python launch_scientist.py --model "gpt-4o-2024-05-13" --experiment amp --num-ideas 2 |
| 92 | + |
| 93 | +python launch_scientist.py --model "claude-3-5-sonnet-20241022" --experiment amp --num-ideas 2 |
| 94 | +``` |
| 95 | + |
| 96 | +## Relevant Directory Subset |
| 97 | +``` |
| 98 | +AI-Scientist/ |
| 99 | +├── launch_scientist.py |
| 100 | +├── requirements.txt |
| 101 | +├── templates/ |
| 102 | +│ └── amp/ |
| 103 | +│ ├── DeepMimic/ |
| 104 | +│ │ └── auto_setup.sh |
| 105 | +│ ├── experiment.py |
| 106 | +│ └── plot.py |
| 107 | +``` |
0 commit comments