Skip to content

Commit e7f3bcb

Browse files
Support for online guidance with vbd_online (#431)
* Delete obsolete vbd functions * Format * Remove all instances of use_vbd and alike -> unified guidance mode * Create dataclass struct for VBD online predictionsions * Delete world_time_steps as it is no longer used * Leaving a todo * Make sure to demean the VBD predicted trajectories * Data analysis and minor changes * Guidance data analysis notebook * Script to process guidance data * Fixes * Fixes * Update nb * Fixes and make sure to always wrap the yaws. * Fixes and make sure to always wrap the yaws. * Example data to work with
1 parent 47713ff commit e7f3bcb

22 files changed

+47815
-501
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ data/processed/training/*
2929
data/processed/testing/*
3030
data/processed/pop_play/*
3131
data/processed/hand_designed/*
32-
analyze/figures/*
32+
figures/
3333
data/other/*
3434
wosac/
3535

baselines/ppo/config/ppo_base_puffer.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,7 @@ environment: # Overrides default environment configs (see pygpudrive/env/config.
4242
obs_radius: 50.0 # Visibility radius of the agents
4343
action_space_steer_disc: 13
4444
action_space_accel_disc: 7
45-
# Versatile Behavior Diffusion (VBD): This will slow down training
46-
use_vbd: false
4745
init_steps: 0
48-
vbd_trajectory_weight: 0.1 # Importance of distance to the vbd trajectories in the reward function
49-
vbd_in_obs: false
5046

5147
wandb:
5248
entity: ""

baselines/ppo/config/ppo_guided_autonomy.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ train:
7575

7676
# # # PPO # # #
7777
torch_deterministic: false
78-
total_timesteps: 2_000_000_000
78+
total_timesteps: 4_000_000_000
7979
batch_size: 131072
8080
minibatch_size: 8192
8181
learning_rate: 3e-4
@@ -105,7 +105,7 @@ train:
105105
num_parameters: 0 # Total trainable parameters, to be filled at runtime
106106

107107
# # # Checkpointing # # #
108-
checkpoint_interval: 50 # Save policy every k iterations
108+
checkpoint_interval: 500 # Save policy every k iterations
109109
checkpoint_path: "./runs"
110110

111111
# # # Rendering # # #

baselines/ppo/config/ppo_population.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,6 @@ environment: # Overrides default environment configs (see pygpudrive/env/config.
4242
action_space_steer_disc: 13
4343
action_space_accel_disc: 7
4444
init_steps: 0 # Warmup steps
45-
# Versatile Behavior Diffusion (VBD): This will slow down training
46-
use_vbd: false
47-
vbd_model_path: "gpudrive/integrations/vbd/weights/epoch=18.ckpt"
48-
vbd_trajectory_weight: 0.1 # Importance of distance to the vbd trajectories in the reward function
49-
vbd_in_obs: false
5045

5146
wandb:
5247
entity: ""

baselines/ppo/ppo_guided_autonomy.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,7 @@ def run(
125125
obs_radius: Annotated[Optional[float], typer.Option(help="The radius for the observation")] = None,
126126
collision_behavior: Annotated[Optional[str], typer.Option(help="The collision behavior; 'ignore' or 'remove'")] = None,
127127
remove_non_vehicles: Annotated[Optional[int], typer.Option(help="Remove non-vehicles from the scene; 0 or 1")] = None,
128-
use_vbd: Annotated[Optional[bool], typer.Option(help="Use VBD model for trajectory predictions")] = False,
129128
vbd_model_path: Annotated[Optional[str], typer.Option(help="Path to VBD model checkpoint")] = None,
130-
vbd_trajectory_weight: Annotated[Optional[float], typer.Option(help="Weight for VBD trajectory deviation penalty")] = 0.1,
131-
vbd_in_obs: Annotated[Optional[bool], typer.Option(help="Include VBD predictions in the observation")] = False,
132129
init_steps: Annotated[Optional[int], typer.Option(help="Environment warmup steps")] = 0,
133130

134131
# Train options
@@ -185,10 +182,7 @@ def run(
185182
"remove_non_vehicles": None
186183
if remove_non_vehicles is None
187184
else bool(remove_non_vehicles),
188-
"use_vbd": use_vbd,
189185
"vbd_model_path": vbd_model_path,
190-
"vbd_trajectory_weight": vbd_trajectory_weight,
191-
"vbd_in_obs": vbd_in_obs,
192186
"init_steps": init_steps,
193187
}
194188
config.environment.update(

baselines/ppo/ppo_pufferlib.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,6 @@ def run(
172172
obs_radius: Annotated[Optional[float], typer.Option(help="The radius for the observation")] = None,
173173
collision_behavior: Annotated[Optional[str], typer.Option(help="The collision behavior; 'ignore' or 'remove'")] = None,
174174
remove_non_vehicles: Annotated[Optional[int], typer.Option(help="Remove non-vehicles from the scene; 0 or 1")] = None,
175-
use_vbd: Annotated[Optional[bool], typer.Option(help="Use VBD model for trajectory predictions")] = False,
176-
vbd_trajectory_weight: Annotated[Optional[float], typer.Option(help="Weight for VBD trajectory deviation penalty")] = 0.1,
177-
vbd_in_obs: Annotated[Optional[bool], typer.Option(help="Include VBD predictions in the observation")] = False,
178175
init_steps: Annotated[Optional[int], typer.Option(help="Environment warmup steps")] = 0,
179176
# Train options
180177
seed: Annotated[Optional[int], typer.Option(help="The seed for training")] = None,
@@ -227,9 +224,6 @@ def run(
227224
"remove_non_vehicles": None
228225
if remove_non_vehicles is None
229226
else bool(remove_non_vehicles),
230-
"use_vbd": use_vbd,
231-
"vbd_trajectory_weight": vbd_trajectory_weight,
232-
"vbd_in_obs": vbd_in_obs,
233227
"init_steps": init_steps,
234228
}
235229
config.environment.update(
2.46 MB
Binary file not shown.
2.43 MB
Binary file not shown.
2.16 MB
Binary file not shown.

0 commit comments

Comments
 (0)