Skip to content

Commit 1d84be3

Browse files
committed
Full implementation of AI Scientist Template for experimentation on Adversarial Motion Priors (AMP) algorithm via the DeepMimic library
Set up template for AMP in Deepmimic Library
1 parent 17620ad commit 1d84be3

File tree

21 files changed

+715
-1
lines changed

21 files changed

+715
-1
lines changed

templates/amp/README.md

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
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+
```
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import subprocess
2+
import os
3+
import sys
4+
import atexit
5+
6+
def run_in_conda_env(env_name):
7+
"""
8+
Re-run the current script in the specified conda environment
9+
"""
10+
conda_path = os.environ.get('CONDA_EXE', 'conda')
11+
current_env = os.environ.get('CONDA_DEFAULT_ENV')
12+
print("Current environment:", current_env)
13+
14+
if current_env != env_name:
15+
script_path = os.path.abspath(sys.argv[0])
16+
script_args = ' '.join(sys.argv[1:])
17+
cmd = f'"{conda_path}" run -n {env_name} python "{script_path}" {script_args}'
18+
19+
print(f"Switching to {env_name} environment...")
20+
try:
21+
process = subprocess.run(cmd, shell=True, check=True)
22+
sys.exit(process.returncode)
23+
except subprocess.CalledProcessError as e:
24+
print(f"Error running script in {env_name}: {str(e)}")
25+
sys.exit(1)
26+
finally:
27+
print(f"Switching back to {current_env} environment...")
88.6 KB
Loading
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
[
2+
{
3+
"Name": "adaptive_reward_weighting",
4+
"Title": "Dynamic Loss Balancing in AMP: Adaptive Reward Weighting for Improved Motion Imitation",
5+
"Experiment": "Implement an adaptive reward weighting system that dynamically adjusts the balance between task and style rewards based on their relative magnitudes during training. The weights should be updated using a moving average of loss ratios. Compare pose error and task performance against the baseline AMP implementation.",
6+
"Interestingness": 7,
7+
"Feasibility": 8,
8+
"Novelty": 6,
9+
"novel": true
10+
},
11+
{
12+
"Name": "hierarchical_discriminator",
13+
"Title": "Multi-Scale Motion Assessment: Hierarchical Discriminators for Natural Movement Generation",
14+
"Experiment": "Modify the AMP discriminator to use a hierarchical architecture with both local and global motion discriminators. The local discriminator focuses on frame-level features while the global discriminator assesses longer temporal sequences. Compare the quality of generated motions against the baseline single discriminator approach.",
15+
"Interestingness": 8,
16+
"Feasibility": 7,
17+
"Novelty": 7,
18+
"novel": true
19+
},
20+
{
21+
"Name": "dataset_specialization",
22+
"Title": "Targeted Motion Priors: Investigating Dataset Specialization in AMP",
23+
"Experiment": "Compare the performance of AMP when trained on specialized motion datasets (e.g., HumanEva focused on basic locomotion) versus general motion capture collections (e.g., full AMASS dataset). Evaluate pose error and motion naturalness for specific tasks like walking.",
24+
"Interestingness": 6,
25+
"Feasibility": 9,
26+
"Novelty": 5,
27+
"novel": true
28+
},
29+
{
30+
"Name": "momentum_features",
31+
"Title": "Physics-Aware Motion Priors: Velocity Feature Enhancement for Natural Movement Synthesis",
32+
"Experiment": "Modify calc_pose_error() to compute joint velocities as frame-to-frame differences. Add velocity_error component weighted at 0.3 relative to existing pose error terms. Extend discriminator input to include joint velocity features. Compare against baseline using both pose error and new velocity error metric. Evaluate on the full range of motions, with particular focus on transitions between different movement types.",
33+
"Interestingness": 8,
34+
"Feasibility": 8,
35+
"Novelty": 8,
36+
"novel": true
37+
},
38+
{
39+
"Name": "progressive_discriminator",
40+
"Title": "Progressive Growing of Discriminators for Refined Motion Imitation",
41+
"Experiment": "Implement two-stage discriminator growth: Start with 2 layers of 512 units, then expand to full 1024 units when disc_reward_mean stabilizes (variance < threshold over 1000 steps). Modify AMPAgent to track reward stability and handle architecture transition. Compare training curves, final pose error, and motion quality against baseline. Analyze impact on early training stability and final motion precision.",
42+
"Interestingness": 8,
43+
"Feasibility": 8,
44+
"Novelty": 8,
45+
"novel": true
46+
}
47+
]
518 KB
Binary file not shown.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Processing report1.pdf...
2+
[========================================] (7/7)
3+
4
4+
Reject
5+
['The method relies on manually tuned motion-specific bounds and hyperparameters (temperature, decay rate), which may introduce biases and limit its applicability to other motion types or domains.', 'Certain sections of the paper, particularly the experimental setup and the autoencoder aggregator, lack clarity, making it difficult to fully evaluate the robustness and reproducibility of the results.', 'The paper does not adequately address potential negative societal impacts or provide detailed qualitative analyses to support the quantitative results.', 'The novelty of the proposed approach may be limited as it builds on existing dynamic weighting techniques in a somewhat incremental manner.', 'The experimental results may not be generalizable due to the limited scope of motion types tested (only walking, jogging, and running).', 'The paper lacks a thorough comparison with a wider range of state-of-the-art methods in the field, limiting the understanding of its relative performance.']
581 KB
Loading
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
[
2+
{
3+
"Name": "adaptive_reward_weighting",
4+
"Title": "Dynamic Loss Balancing in AMP: Adaptive Reward Weighting for Improved Motion Imitation",
5+
"Experiment": "Implement an adaptive reward weighting system that dynamically adjusts the balance between task and style rewards based on their relative magnitudes during training. The weights should be updated using a moving average of loss ratios. Compare pose error and task performance against the baseline AMP implementation.",
6+
"Interestingness": 7,
7+
"Feasibility": 8,
8+
"Novelty": 6,
9+
"novel": true
10+
},
11+
{
12+
"Name": "hierarchical_discriminator",
13+
"Title": "Multi-Scale Motion Assessment: Hierarchical Discriminators for Natural Movement Generation",
14+
"Experiment": "Modify the AMP discriminator to use a hierarchical architecture with both local and global motion discriminators. The local discriminator focuses on frame-level features while the global discriminator assesses longer temporal sequences. Compare the quality of generated motions against the baseline single discriminator approach.",
15+
"Interestingness": 8,
16+
"Feasibility": 7,
17+
"Novelty": 7,
18+
"novel": true
19+
},
20+
{
21+
"Name": "dataset_specialization",
22+
"Title": "Targeted Motion Priors: Investigating Dataset Specialization in AMP",
23+
"Experiment": "Compare the performance of AMP when trained on specialized motion datasets (e.g., HumanEva focused on basic locomotion) versus general motion capture collections (e.g., full AMASS dataset). Evaluate pose error and motion naturalness for specific tasks like walking.",
24+
"Interestingness": 6,
25+
"Feasibility": 9,
26+
"Novelty": 5,
27+
"novel": true
28+
},
29+
{
30+
"Name": "temporal_motion_discriminator",
31+
"Title": "Learning Natural Motion Dynamics: Temporal Discriminators for Physics-Based Character Animation",
32+
"Experiment": "Implement a simplified temporal discriminator using a fixed 15-frame window. Modifications: 1) Create a sequence buffer that maintains recent state history 2) Add two 1D conv layers (kernel size 5, 64 channels) followed by the existing fully connected layers 3) Compute temporal features: joint velocities and accelerations over the window. Compare against baseline using: a) average joint velocity consistency b) pose error c) discriminator loss convergence. Focus on walking motion as primary test case.",
33+
"Interestingness": 9,
34+
"Feasibility": 8,
35+
"Novelty": 8,
36+
"novel": true
37+
},
38+
{
39+
"Name": "curriculum_adversarial_training",
40+
"Title": "Balanced Curriculum Learning for Motion Imitation Networks",
41+
"Experiment": "Modify AMPAgent to implement dynamic learning rate adjustment: 1) Track discriminator accuracy using average output probabilities for real/fake samples 2) When discriminator accuracy exceeds 0.8, reduce policy learning rate by 50% and increase discriminator learning rate by 50% 3) When discriminator accuracy drops below 0.6, do the opposite 4) Compare against baseline using: time to convergence, final pose error, and learning stability measured by reward variance. Test on walk, run, and jump motions to verify generalization",
42+
"Interestingness": 8,
43+
"Feasibility": 9,
44+
"Novelty": 7,
45+
"novel": true
46+
}
47+
]
647 KB
Binary file not shown.

0 commit comments

Comments
 (0)