From f31436bccd14fdb7866f6d7a826167fcb23257a5 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Tue, 31 Mar 2026 19:53:15 +0000 Subject: [PATCH] feat(config): add YAML configuration system - Add default_ppo.yaml template for training configurations - Create configs/README.md with usage documentation - Enable per-researcher configuration without code changes - Support YAML config files with CLI parameter overrides - Document how to set personal WandB credentials safely This allows researchers to maintain personal configs without committing credentials to the repository. --- configs/README.md | 48 ++++++++++++++++++++++++++++++++++++++++ configs/default_ppo.yaml | 48 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 96 insertions(+) create mode 100644 configs/README.md create mode 100644 configs/default_ppo.yaml diff --git a/configs/README.md b/configs/README.md new file mode 100644 index 0000000..d06fbb2 --- /dev/null +++ b/configs/README.md @@ -0,0 +1,48 @@ +# Configuration Files + +This directory contains configuration files for training experiments. + +## Usage + +Configuration files use YAML format and allow you to specify all training parameters in one place. + +### Quick Start + +Copy the default configuration template: +```bash +cp configs/default_ppo.yaml configs/my_experiment.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 + +Run training with your config: +```bash +python src/train.py --config configs/my_experiment.yaml +``` + +### Override Parameters + +You can override any parameter from the command line: +```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! +``` + +This approach allows everyone to use the codebase without modifying source files. + +## Available Configurations + +- `default_ppo.yaml` - Default PPO training configuration template diff --git a/configs/default_ppo.yaml b/configs/default_ppo.yaml new file mode 100644 index 0000000..5775a84 --- /dev/null +++ b/configs/default_ppo.yaml @@ -0,0 +1,48 @@ +# PPO Training Configuration Template +# +# This file provides an example configuration for PPO training. +# Copy this file and modify it for your specific experiments. +# +# Usage: +# python src/train.py --config-path configs/my_config.yaml +# Or override specific parameters: +# python src/train.py --learning-rate 0.001 --num-envs 32 + +# Experiment settings +exp_name: "brittle_star_ppo" +seed: 1 + +# Tracking settings +track: false # Set to true to enable WandB logging +wandb_project_name: "PPO-Modularity" +wandb_entity: null # Set to your WandB username or team name + +# Model saving +save_model: true +checkpoint_frequency: 100 # Save checkpoint every N iterations (0 = no checkpoints) + +# Environment settings +num_envs: 16 + +# Training hyperparameters +total_timesteps: 10000000 +learning_rate: 0.00025 +num_steps: 128 +anneal_lr: true + +# PPO specific +gamma: 0.99 +gae_lambda: 0.95 +num_minibatches: 4 +update_epochs: 4 +norm_adv: true +clip_coef: 0.1 +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