feat(config): add YAML config templates for dev, production and personal use
This commit is contained in:
parent
d27a617199
commit
2001a92e75
4 changed files with 195 additions and 26 deletions
|
|
@ -2,47 +2,91 @@
|
||||||
|
|
||||||
This directory contains configuration files for training experiments.
|
This directory contains configuration files for training experiments.
|
||||||
|
|
||||||
## Usage
|
## Quick Start
|
||||||
|
|
||||||
Configuration files use YAML format and allow you to specify all training parameters in one place.
|
### 1. Choose a Template
|
||||||
|
|
||||||
### Quick Start
|
**For Development/Testing:**
|
||||||
|
|
||||||
Copy the default configuration template:
|
|
||||||
```bash
|
```bash
|
||||||
cp configs/default_ppo.yaml configs/my_experiment.yaml
|
cp configs/dev_test.yaml configs/my_dev.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
Edit `my_experiment.yaml` to customize your experiment settings, particularly:
|
**For Production Training:**
|
||||||
- `wandb_entity`: Your WandB username or team name
|
```bash
|
||||||
- `track`: Set to `true` to enable WandB logging
|
cp configs/production_training.yaml configs/my_experiment.yaml
|
||||||
- Training hyperparameters as needed
|
```
|
||||||
|
|
||||||
Run training with your config:
|
### 2. Configure Your Settings
|
||||||
|
|
||||||
|
Edit your config file and **set your wandb entity**:
|
||||||
|
```yaml
|
||||||
|
# ⚠️ IMPORTANT: Set this to your WandB username or team name
|
||||||
|
wandb_entity: "your-wandb-username"
|
||||||
|
track: true # Enable WandB logging
|
||||||
|
```
|
||||||
|
|
||||||
|
### 3. Run Training
|
||||||
|
|
||||||
|
**Using config file:**
|
||||||
```bash
|
```bash
|
||||||
python src/train.py --config configs/my_experiment.yaml
|
python src/train.py --config configs/my_experiment.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
### Override Parameters
|
**Override specific parameters:**
|
||||||
|
|
||||||
You can override any parameter from the command line:
|
|
||||||
```bash
|
```bash
|
||||||
python src/train.py --config configs/my_experiment.yaml --learning-rate 0.001 --num-envs 32
|
python src/train.py --config configs/my_experiment.yaml --learning-rate 0.001 --num-envs 32
|
||||||
```
|
```
|
||||||
|
|
||||||
### Configuration for Different Users
|
**Pure CLI (no config file):**
|
||||||
|
```bash
|
||||||
Each researcher should create their own config file with their WandB settings:
|
python src/train.py --track --wandb-entity your-username --total-timesteps 1000000
|
||||||
```yaml
|
|
||||||
# configs/researcher_name.yaml
|
|
||||||
exp_name: "researcher_name_experiment"
|
|
||||||
track: true
|
|
||||||
wandb_project_name: "PPO-Modularity"
|
|
||||||
wandb_entity: "your-wandb-username" # Change this!
|
|
||||||
```
|
```
|
||||||
|
|
||||||
This approach allows everyone to use the codebase without modifying source files.
|
## Features
|
||||||
|
|
||||||
## Available Configurations
|
### 📊 WandB Integration
|
||||||
|
- Real-time metrics logging
|
||||||
|
- Model checkpoints as artifacts
|
||||||
|
- Run comparison and collaboration
|
||||||
|
|
||||||
- `default_ppo.yaml` - Default PPO training configuration template
|
### 🔧 Flexible Configuration
|
||||||
|
- YAML files for reproducible experiments
|
||||||
|
- CLI overrides for quick adjustments
|
||||||
|
- Team collaboration without code changes
|
||||||
|
|
||||||
|
## Configuration Templates
|
||||||
|
|
||||||
|
### `dev_test.yaml`
|
||||||
|
- Fast iteration for development
|
||||||
|
- Short runs (100K timesteps)
|
||||||
|
- Frequent checkpoints
|
||||||
|
- Small environment count
|
||||||
|
|
||||||
|
### `production_training.yaml`
|
||||||
|
- Full-scale training (50M timesteps)
|
||||||
|
- Optimized hyperparameters
|
||||||
|
- Production-ready settings
|
||||||
|
|
||||||
|
### `default_ppo.yaml`
|
||||||
|
- Baseline configuration template
|
||||||
|
- Balanced settings for most use cases
|
||||||
|
|
||||||
|
## Team Collaboration
|
||||||
|
|
||||||
|
Each team member should create their own config file:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
# configs/alice_experiment.yaml
|
||||||
|
exp_name: "alice_locomotion_v2"
|
||||||
|
track: true
|
||||||
|
wandb_project_name: "PPO-Modularity"
|
||||||
|
wandb_entity: "alice-research" # Alice's WandB username
|
||||||
|
total_timesteps: 20000000
|
||||||
|
# ... other settings
|
||||||
|
```
|
||||||
|
|
||||||
|
This allows everyone to:
|
||||||
|
- Use their own WandB account
|
||||||
|
- Run different experiments simultaneously
|
||||||
|
- Share configurations via version control
|
||||||
|
- Avoid conflicts in run names
|
||||||
|
|
|
||||||
42
configs/dev_test.yaml
Normal file
42
configs/dev_test.yaml
Normal file
|
|
@ -0,0 +1,42 @@
|
||||||
|
# Quick Development/Testing Configuration
|
||||||
|
#
|
||||||
|
# Fast configuration for development and testing with short runs.
|
||||||
|
|
||||||
|
# Experiment settings
|
||||||
|
exp_name: "brittle_star_dev_test"
|
||||||
|
seed: 123
|
||||||
|
|
||||||
|
# Tracking settings - IMPORTANT: Set your own wandb_entity!
|
||||||
|
track: true
|
||||||
|
wandb_project_name: "PPO-Modularity-Dev"
|
||||||
|
wandb_entity: null # ⚠️ SET THIS TO YOUR WANDB USERNAME OR TEAM
|
||||||
|
|
||||||
|
# Model saving
|
||||||
|
save_model: true
|
||||||
|
checkpoint_frequency: 10 # More frequent checkpoints for testing
|
||||||
|
|
||||||
|
# Environment settings
|
||||||
|
num_envs: 4 # Smaller for faster iteration
|
||||||
|
|
||||||
|
# Training hyperparameters - Fast/testing
|
||||||
|
total_timesteps: 100000 # Short run for testing
|
||||||
|
learning_rate: 0.001 # Higher learning rate for faster learning
|
||||||
|
num_steps: 64 # Shorter rollouts
|
||||||
|
anneal_lr: true
|
||||||
|
|
||||||
|
# PPO specific - Optimized for quick results
|
||||||
|
gamma: 0.99
|
||||||
|
gae_lambda: 0.95
|
||||||
|
num_minibatches: 2
|
||||||
|
update_epochs: 2 # Fewer epochs for speed
|
||||||
|
norm_adv: true
|
||||||
|
clip_coef: 0.1
|
||||||
|
clip_vloss: true
|
||||||
|
ent_coef: 0.02 # Higher entropy for exploration
|
||||||
|
vf_coef: 0.5
|
||||||
|
max_grad_norm: 0.5
|
||||||
|
target_kl: null
|
||||||
|
|
||||||
|
# Hardware
|
||||||
|
cuda: true
|
||||||
|
torch_deterministic: true
|
||||||
40
configs/personal_template.yaml
Normal file
40
configs/personal_template.yaml
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
# Personal Configuration Example for Team Member
|
||||||
|
#
|
||||||
|
# Copy this template and customize for your personal experiments
|
||||||
|
|
||||||
|
# Experiment settings - PERSONALIZE THESE
|
||||||
|
exp_name: "YOUR_NAME_experiment_v1" # ⚠️ Change YOUR_NAME
|
||||||
|
seed: 42
|
||||||
|
|
||||||
|
# WandB settings - ⚠️ IMPORTANT: Set your credentials!
|
||||||
|
track: true # Enable WandB tracking
|
||||||
|
wandb_project_name: "PPO-Modularity"
|
||||||
|
wandb_entity: "YOUR_WANDB_USERNAME" # ⚠️ CHANGE THIS to your WandB username/team
|
||||||
|
|
||||||
|
# Quick experiment settings (modify as needed)
|
||||||
|
total_timesteps: 500000 # 500K for quick results
|
||||||
|
num_envs: 8
|
||||||
|
learning_rate: 0.0005
|
||||||
|
num_steps: 128
|
||||||
|
|
||||||
|
# Model saving
|
||||||
|
save_model: true
|
||||||
|
checkpoint_frequency: 25 # Save checkpoints frequently
|
||||||
|
|
||||||
|
# Standard PPO settings (usually don't need to change)
|
||||||
|
gamma: 0.99
|
||||||
|
gae_lambda: 0.95
|
||||||
|
num_minibatches: 4
|
||||||
|
update_epochs: 4
|
||||||
|
norm_adv: true
|
||||||
|
clip_coef: 0.2
|
||||||
|
clip_vloss: true
|
||||||
|
ent_coef: 0.01
|
||||||
|
vf_coef: 0.5
|
||||||
|
max_grad_norm: 0.5
|
||||||
|
target_kl: null
|
||||||
|
anneal_lr: true
|
||||||
|
|
||||||
|
# Hardware
|
||||||
|
cuda: true
|
||||||
|
torch_deterministic: true
|
||||||
43
configs/production_training.yaml
Normal file
43
configs/production_training.yaml
Normal file
|
|
@ -0,0 +1,43 @@
|
||||||
|
# Production Training Configuration
|
||||||
|
#
|
||||||
|
# Full-scale training configuration for production runs
|
||||||
|
# with wandb logging enabled.
|
||||||
|
|
||||||
|
# Experiment settings
|
||||||
|
exp_name: "brittle_star_production"
|
||||||
|
seed: 42
|
||||||
|
|
||||||
|
# Tracking settings - IMPORTANT: Set your own wandb_entity!
|
||||||
|
track: true
|
||||||
|
wandb_project_name: "PPO-Modularity"
|
||||||
|
wandb_entity: null # ⚠️ SET THIS TO YOUR WANDB USERNAME OR TEAM
|
||||||
|
|
||||||
|
# Model saving
|
||||||
|
save_model: true
|
||||||
|
checkpoint_frequency: 100 # Save checkpoint every 100 iterations
|
||||||
|
|
||||||
|
# Environment settings
|
||||||
|
num_envs: 32 # Increased for production
|
||||||
|
|
||||||
|
# Training hyperparameters - Production scale
|
||||||
|
total_timesteps: 50000000 # 50M timesteps for full training
|
||||||
|
learning_rate: 0.00025
|
||||||
|
num_steps: 256 # Longer rollouts
|
||||||
|
anneal_lr: true
|
||||||
|
|
||||||
|
# PPO specific - Fine-tuned
|
||||||
|
gamma: 0.99
|
||||||
|
gae_lambda: 0.95
|
||||||
|
num_minibatches: 8 # More minibatches for stability
|
||||||
|
update_epochs: 4
|
||||||
|
norm_adv: true
|
||||||
|
clip_coef: 0.2
|
||||||
|
clip_vloss: true
|
||||||
|
ent_coef: 0.01
|
||||||
|
vf_coef: 0.5
|
||||||
|
max_grad_norm: 0.5
|
||||||
|
target_kl: null
|
||||||
|
|
||||||
|
# Hardware
|
||||||
|
cuda: true
|
||||||
|
torch_deterministic: true
|
||||||
Reference in a new issue