diff --git a/configs/README.md b/configs/README.md index d06fbb2..ac6d5e1 100644 --- a/configs/README.md +++ b/configs/README.md @@ -2,47 +2,91 @@ 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 - -Copy the default configuration template: +**For Development/Testing:** ```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: -- `wandb_entity`: Your WandB username or team name -- `track`: Set to `true` to enable WandB logging -- Training hyperparameters as needed +**For Production Training:** +```bash +cp configs/production_training.yaml configs/my_experiment.yaml +``` -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 python src/train.py --config configs/my_experiment.yaml ``` -### Override Parameters - -You can override any parameter from the command line: +**Override specific parameters:** ```bash python src/train.py --config configs/my_experiment.yaml --learning-rate 0.001 --num-envs 32 ``` -### Configuration for Different Users - -Each researcher should create their own config file with their WandB settings: -```yaml -# configs/researcher_name.yaml -exp_name: "researcher_name_experiment" -track: true -wandb_project_name: "PPO-Modularity" -wandb_entity: "your-wandb-username" # Change this! +**Pure CLI (no config file):** +```bash +python src/train.py --track --wandb-entity your-username --total-timesteps 1000000 ``` -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 diff --git a/configs/dev_test.yaml b/configs/dev_test.yaml new file mode 100644 index 0000000..194c544 --- /dev/null +++ b/configs/dev_test.yaml @@ -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 \ No newline at end of file diff --git a/configs/personal_template.yaml b/configs/personal_template.yaml new file mode 100644 index 0000000..91c1ce6 --- /dev/null +++ b/configs/personal_template.yaml @@ -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 \ No newline at end of file diff --git a/configs/production_training.yaml b/configs/production_training.yaml new file mode 100644 index 0000000..54cf4ef --- /dev/null +++ b/configs/production_training.yaml @@ -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 \ No newline at end of file