Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
623 changes: 0 additions & 623 deletions pufferlib/config/ocean/drive.ini

This file was deleted.

104 changes: 104 additions & 0 deletions pufferlib/config/ocean/drive/eval/behaviors.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# Driving-behaviour evaluation: nuPlan scenes labeled by scene type. Each
# behavior is one [eval.behaviors_*] section inheriting the shared template.

behaviors_defaults:
enabled: false
interval: 250
mode: inline
clean: true
render: true
render_views: ["sim_state", "bev"]
env:
simulation_mode: replay
control_mode: control_sdc_only
init_mode: create_all_valid
scenario_length: 201
obs_slots_partners_n: 32
eval:
num_scenarios: 50
render_num_scenarios: 2
render_max_steps: 200

behaviors_full_dir:
inherits: behaviors_defaults
type: behavior_class
enabled: true
env:
map_dir: /scratch/ev2237/data/nuplan/nuplan_mini_train_bins

behaviors_hard_stop:
inherits: behaviors_defaults
type: behavior_class
enabled: true
env:
map_dir: /scratch/ev2237/data/nuplan/categories_v021/hard_stop

behaviors_highway_straight:
inherits: behaviors_defaults
type: behavior_class
enabled: true
env:
map_dir: /scratch/ev2237/data/nuplan/categories_v021/highway_straight

behaviors_lane_change:
inherits: behaviors_defaults
type: behavior_class
enabled: true
env:
map_dir: /scratch/ev2237/data/nuplan/categories_v021/lane_change

behaviors_merge:
inherits: behaviors_defaults
type: behavior_class
enabled: true
env:
map_dir: /scratch/ev2237/data/nuplan/categories_v021/merge

behaviors_parked_cars:
inherits: behaviors_defaults
type: behavior_class
enabled: true
env:
map_dir: /scratch/ev2237/data/nuplan/categories_v021/parked_cars

behaviors_roundabout:
inherits: behaviors_defaults
type: behavior_class
enabled: true
env:
map_dir: /scratch/ev2237/data/nuplan/categories_v021/roundabout

behaviors_stopped_traffic:
inherits: behaviors_defaults
type: behavior_class
enabled: true
env:
map_dir: /scratch/ev2237/data/nuplan/categories_v021/stopped_traffic

behaviors_traffic_light_green:
inherits: behaviors_defaults
type: behavior_class
enabled: true
env:
map_dir: /scratch/ev2237/data/nuplan/categories_v021/traffic_light_green

behaviors_traffic_light_stop:
inherits: behaviors_defaults
type: behavior_class
enabled: true
env:
map_dir: /scratch/ev2237/data/nuplan/categories_v021/traffic_light_stop

behaviors_unprotected_left:
inherits: behaviors_defaults
type: behavior_class
enabled: true
env:
map_dir: /scratch/ev2237/data/nuplan/categories_v021/unprotected_left

behaviors_unprotected_right:
inherits: behaviors_defaults
type: behavior_class
enabled: true
env:
map_dir: /scratch/ev2237/data/nuplan/categories_v021/unprotected_right
97 changes: 97 additions & 0 deletions pufferlib/config/ocean/drive/eval/validation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# Multi-scenario validation suite. `validation_defaults` is a template (no
# `type`); the replay/gigaflow/triage sections inherit it and add their
# sim-specific map set + agent layout. Each lands under [eval.<name>].

validation_defaults:
enabled: true
interval: 250
mode: inline
clean: true
env:
eval_mode: 1
collision_behavior: 1
offroad_behavior: 1
# Explicit 0 wins over the clean macro's red-light enforcement.
traffic_light_behavior: 0
reward_randomization: false
termination_mode: 0
num_agents: 1024
target_type: static
goal_speed: 3.0
reward_collision: 3.0
reward_offroad: 3.0
reward_stop_line: 1.0
reward_goal: 1.0
reward_overspeed: 0.05
reward_comfort: 0.05
reward_velocity: 0.0025
reward_lane_align: 0.025
reward_lane_center: 0.0038
reward_timestep: 0.000025
reward_reverse: 0.005
reward_ade: 0.0
obs_dropout_lane: 0.0
obs_dropout_boundary: 0.0
obs_slots_lane_n: 80
obs_slots_boundary_n: 80
eval:
num_scenarios: 250
export_episode_csv: true
verify_coverage: true

validation_replay:
inherits: validation_defaults
type: multi_scenario
enabled: true
render: true
render_backend: triage_html
env:
simulation_mode: replay
control_mode: control_sdc_only
map_dir: /scratch/ev2237/data/nuplan/nuplan_mini_train_bins
num_maps: 250
max_agents_per_env: 64
scenario_length: 200
resample_frequency: 200
eval:
render_num_scenarios: 5
render_max_steps: 200

validation_gigaflow:
inherits: validation_defaults
type: multi_scenario
enabled: true
render: true
render_backend: egl
render_views: ["sim_state", "bev"]
env:
simulation_mode: gigaflow
map_dir: pufferlib/resources/drive/binaries/carla
num_maps: 8
num_agents: 1024
min_agents_per_env: 40
max_agents_per_env: 40
scenario_length: 500
resample_frequency: 500
eval:
render_num_scenarios: 8
render_max_steps: 300

dnf_triage:
inherits: validation_defaults
type: multi_scenario
enabled: false
render: true
render_backend: triage_html
env:
simulation_mode: gigaflow
map_dir: pufferlib/resources/drive/binaries/carla/opendrive__Town10HD.bin
num_maps: 1
min_agents_per_env: 1
max_agents_per_env: 1
scenario_length: 500
resample_frequency: 500
eval:
num_scenarios: 32
render_num_scenarios: 16
render_max_steps: 300
18 changes: 18 additions & 0 deletions pufferlib/config/ocean/drive/eval/wosac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Optional WOSAC realism eval. Off by default; runs as a subprocess.
wosac:
type: wosac
enabled: false
interval: 500
mode: subprocess
clean: true
render: false
env:
control_mode: control_wosac
init_mode: create_all_valid
init_step: 10
goal_radius: 2.0
eval:
wosac_num_rollouts: 32
wosac_num_agents: 256
wosac_sanity_check: false
wosac_aggregate_results: true
36 changes: 36 additions & 0 deletions pufferlib/config/ocean/drive/model/gigaflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Policy/network definition (internal sections: [base] net ids, [policy], [rnn]).
base:
policy_name: Drive
# Options: Recurrent, None
rnn_name: null

policy:
# Encoder layer (per-encoder embedding width)
ego_input_size: 64
partner_input_size: 64
lane_input_size: 64
boundary_input_size: 64
traffic_control_input_size: 64
context_input_size: 64
# Encoder activation - options: "relu", "tanh", "gelu"
encoder_activation: relu
encoder_layer_norm: true
mask_padded_features: false
# Shared backbone layer
backbone_hidden_size: 512
backbone_num_layers: 4
# Backbone activation - options: "relu", "tanh", "gelu"
backbone_activation: gelu
backbone_layer_norm: false
# Actor head layer
actor_hidden_size: 512
actor_num_layers: 0
# Critic head layer
critic_hidden_size: 512
critic_num_layers: 0
# Dual or shared actor-critic backbone
shared_network: true

rnn:
input_size: 512
hidden_size: 512
35 changes: 35 additions & 0 deletions pufferlib/config/ocean/drive/recipes/default.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Default PufferDrive training recipe. Selects one component per group plus a
# list of eval suites. Swap a group on the CLI, e.g.
# puffer train puffer_drive --config <this file>
# or point --config at a sibling recipe to define a different experiment.

package: ocean
env_name: puffer_drive

vecenv: default # -> ../vecenv/default.yaml ([vec])
train: default # -> ../train/default.yaml ([train])
simulator: gigaflow_carla # -> ../simulator/gigaflow_carla.yaml ([env])
model: gigaflow # -> ../model/gigaflow.yaml ([base]/[policy]/[rnn])

eval: # each -> ../eval/<name>.yaml
- validation
- behaviors
- wosac

# --- Inline sections (merged verbatim, not from component files) ---

# Failure-mining workflow: `puffer mine_failures puffer_drive ...`
mine:
output_dir: ""
num_episodes: 100
score_threshold: -inf
render: true

# Controlled experiments: `puffer controlled_exp puffer_drive` runs the cross
# product of these value lists.
controlled_exp:
train:
learning_rate:
values: [0.001, 0.003, 0.01]
ent_coef:
values: [0.01, 0.005]
25 changes: 25 additions & 0 deletions pufferlib/config/ocean/drive/recipes/replay_nuplan.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# nuPlan replay training: ego SDC learns against log-replayed traffic.
# Same puffer_drive env as the default recipe, swapped to the replay_nuplan
# simulator profile, with validation switched off (empty eval list).
#
# puffer train puffer_drive --config pufferlib/config/ocean/drive/recipes/replay_nuplan.yaml

package: ocean
env_name: puffer_drive

vecenv: default
train: default
model: gigaflow
simulator: replay_nuplan # replay mode, nuPlan maps, termination_mode 1, 200 steps

eval: [] # no validation suites

# Patch a few values on top of the chosen components. Replay batches are
# smaller than gigaflow, so a smaller minibatch and higher entropy bonus help,
# as in the old replay_sdc config.
overrides:
train:
seed: 555
ent_coef: 0.19
minibatch_size: 8192
checkpoint_interval: 1000
Loading
Loading