From 2a7537f51cbec072f3e96265da08578669ac2a21 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Tue, 14 Apr 2026 22:43:28 +0200 Subject: [PATCH] feat: add modular configuration files --- configs/arena/default.yaml | 8 ++++++++ configs/environment/directed_locomotion.yaml | 12 ++++++++++++ configs/environment/light_escape.yaml | 12 ++++++++++++ configs/experiment/base.yaml | 7 +++++++ configs/experiment/dev_test.yaml | 7 +++++++ configs/experiment/hpc_smoke_test.yaml | 7 +++++++ configs/logging/default.yaml | 11 +++++++++++ configs/logging/wandb_enabled.yaml | 11 +++++++++++ configs/morphology/3_arms.yaml | 6 ++++++ configs/morphology/5_arms_full.yaml | 6 ++++++ configs/morphology/partial_amputation.yaml | 6 ++++++ configs/ppo/default.yaml | 19 +++++++++++++++++++ configs/ppo/fast.yaml | 19 +++++++++++++++++++ configs/ppo/stable.yaml | 19 +++++++++++++++++++ 14 files changed, 150 insertions(+) create mode 100644 configs/arena/default.yaml create mode 100644 configs/environment/directed_locomotion.yaml create mode 100644 configs/environment/light_escape.yaml create mode 100644 configs/experiment/base.yaml create mode 100644 configs/experiment/dev_test.yaml create mode 100644 configs/experiment/hpc_smoke_test.yaml create mode 100644 configs/logging/default.yaml create mode 100644 configs/logging/wandb_enabled.yaml create mode 100644 configs/morphology/3_arms.yaml create mode 100644 configs/morphology/5_arms_full.yaml create mode 100644 configs/morphology/partial_amputation.yaml create mode 100644 configs/ppo/default.yaml create mode 100644 configs/ppo/fast.yaml create mode 100644 configs/ppo/stable.yaml diff --git a/configs/arena/default.yaml b/configs/arena/default.yaml new file mode 100644 index 0000000..c42ec3c --- /dev/null +++ b/configs/arena/default.yaml @@ -0,0 +1,8 @@ +# Default Arena Configuration +# Base aquarium environment settings. + +size: [10.0, 5.0] +sand_ground_color: true +attach_target: true +wall_height: 1.5 +wall_thickness: 0.1 diff --git a/configs/environment/directed_locomotion.yaml b/configs/environment/directed_locomotion.yaml new file mode 100644 index 0000000..63ad520 --- /dev/null +++ b/configs/environment/directed_locomotion.yaml @@ -0,0 +1,12 @@ +# Directed Locomotion Environment +# Baseline task setting. + +task: DIRECTED_LOCOMOTION +simulation_time: 5.0 +num_physics_steps_per_control_step: 10 +time_scale: 2 +camera_ids: [0, 1] +render_size: [480, 640] +joint_randomization_noise_scale: 0.0 +target_distance: 3.0 +light_perlin_noise_scale: 0 diff --git a/configs/environment/light_escape.yaml b/configs/environment/light_escape.yaml new file mode 100644 index 0000000..c79cfb9 --- /dev/null +++ b/configs/environment/light_escape.yaml @@ -0,0 +1,12 @@ +# Light Escape Environment +# Advanced task requiring movement away from light source. + +task: LIGHT_ESCAPE +simulation_time: 5.0 +num_physics_steps_per_control_step: 10 +time_scale: 2 +camera_ids: [0, 1] +render_size: [480, 640] +joint_randomization_noise_scale: 0.0 +target_distance: 3.0 +light_perlin_noise_scale: 200 # Must be integer factor of 200 diff --git a/configs/experiment/base.yaml b/configs/experiment/base.yaml new file mode 100644 index 0000000..9f31d27 --- /dev/null +++ b/configs/experiment/base.yaml @@ -0,0 +1,7 @@ +# Base Experiment Configuration +# Default values align with ExperimentConfig dataclass. + +exp_name: "brittle_star_ppo" +seed: 1 +torch_deterministic: true +cuda: true diff --git a/configs/experiment/dev_test.yaml b/configs/experiment/dev_test.yaml new file mode 100644 index 0000000..941a1e9 --- /dev/null +++ b/configs/experiment/dev_test.yaml @@ -0,0 +1,7 @@ +# Testing Experiment Configuration +# Quick experiment for local development/testing. + +exp_name: "dev_test_brittle_star" +seed: 42 +torch_deterministic: true +cuda: true diff --git a/configs/experiment/hpc_smoke_test.yaml b/configs/experiment/hpc_smoke_test.yaml new file mode 100644 index 0000000..4264801 --- /dev/null +++ b/configs/experiment/hpc_smoke_test.yaml @@ -0,0 +1,7 @@ +# HPC Smoke Test Configuration +# Uses minimal settings but simulates HPC environment. + +exp_name: "hpc_smoke_test" +seed: 123 +torch_deterministic: true +cuda: true diff --git a/configs/logging/default.yaml b/configs/logging/default.yaml new file mode 100644 index 0000000..4a0cb92 --- /dev/null +++ b/configs/logging/default.yaml @@ -0,0 +1,11 @@ +# Default Logging Configuration +# Offline local-only setup (WandB disabled). + +track: false +wandb_project_name: "PPO-Modularity" +wandb_entity: "SEL3-2026-Groep-4" +capture_video: false +save_model: true +checkpoint_frequency: 100 +upload_model: false +hf_entity: "" diff --git a/configs/logging/wandb_enabled.yaml b/configs/logging/wandb_enabled.yaml new file mode 100644 index 0000000..2e82781 --- /dev/null +++ b/configs/logging/wandb_enabled.yaml @@ -0,0 +1,11 @@ +# WandB Enabled Logging Configuration +# For production/cloud experiments with weights synced. + +track: true +wandb_project_name: "PPO-Modularity" +wandb_entity: "SEL3-2026-Groep-4" +capture_video: false +save_model: true +checkpoint_frequency: 100 +upload_model: false +hf_entity: "" diff --git a/configs/morphology/3_arms.yaml b/configs/morphology/3_arms.yaml new file mode 100644 index 0000000..ebc1665 --- /dev/null +++ b/configs/morphology/3_arms.yaml @@ -0,0 +1,6 @@ +# 3 Arms Morphology Configuration +# Symmetric amputation (arms 1 and 3 removed). + +segments_per_arm: [4, 0, 4, 0, 4] +use_p_control: true +use_torque_control: false diff --git a/configs/morphology/5_arms_full.yaml b/configs/morphology/5_arms_full.yaml new file mode 100644 index 0000000..408b7c9 --- /dev/null +++ b/configs/morphology/5_arms_full.yaml @@ -0,0 +1,6 @@ +# 5 Arms Full Morphology Configuration +# Baseline 5-arm brittle star. + +segments_per_arm: [4, 4, 4, 4, 4] +use_p_control: true +use_torque_control: false diff --git a/configs/morphology/partial_amputation.yaml b/configs/morphology/partial_amputation.yaml new file mode 100644 index 0000000..8003035 --- /dev/null +++ b/configs/morphology/partial_amputation.yaml @@ -0,0 +1,6 @@ +# Partial Amputation Configuration +# Random partial amputation for robustness testing. + +segments_per_arm: [4, 2, 4, 4, 4] +use_p_control: true +use_torque_control: false diff --git a/configs/ppo/default.yaml b/configs/ppo/default.yaml new file mode 100644 index 0000000..50107b4 --- /dev/null +++ b/configs/ppo/default.yaml @@ -0,0 +1,19 @@ +# Default PPO Configuration +# Standard hyperparams from original codebase. + +learning_rate: 0.00025 +total_timesteps: 10000000 +num_envs: 100 +num_steps: 128 +anneal_lr: true +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 diff --git a/configs/ppo/fast.yaml b/configs/ppo/fast.yaml new file mode 100644 index 0000000..5001ef2 --- /dev/null +++ b/configs/ppo/fast.yaml @@ -0,0 +1,19 @@ +# Fast PPO Configuration +# Lower timestep count for quick iterations/testing. + +learning_rate: 0.0005 +total_timesteps: 500000 +num_envs: 8 +num_steps: 128 +anneal_lr: true +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 diff --git a/configs/ppo/stable.yaml b/configs/ppo/stable.yaml new file mode 100644 index 0000000..35cade4 --- /dev/null +++ b/configs/ppo/stable.yaml @@ -0,0 +1,19 @@ +# Stable PPO Configuration +# Standard hyperparams with lower LR and larger batch. + +learning_rate: 0.0001 +total_timesteps: 10000000 +num_envs: 100 +num_steps: 256 +anneal_lr: true +gamma: 0.99 +gae_lambda: 0.95 +num_minibatches: 8 +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