Skip to content

Vb/training render - #577

Open
Victorbares wants to merge 2 commits into
3.0from
vb/training_render
Open

Vb/training render#577
Victorbares wants to merge 2 commits into
3.0from
vb/training_render

Conversation

@Victorbares

@Victorbares Victorbares commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

What

  • Training-Distribution Eval Mode (eval_training_render): Adds a mode to evaluate and render the
    exact, randomized environment distribution from training (randomized agent counts, training vehicle
    size ranges, and training traffic light logic) instead of static evaluation settings.
  • Perturbation Rendering of phantom brakers agents and blind agents

Why

  • Realistic Scenario Debugging: Bridges the gap between simplified, deterministic evaluation
    benchmarks and the complex, noisy scenario distributions experienced during training.
  • Explainable Failures: Visualizes active perturbations in HTML playbacks, instantly clarifying
    whether an agent's sudden braking or collision was due to a policy error or an active perturbation.

Notes

  • C Rebuild: Requires a C extension rebuild after merging: python setup.py build_ext --inplace
    --force.
  • Pre-requisites: Mode requires eval_mode=True, simulation_mode='gigaflow', and num_agents >=
    max_agents_per_env.
  • env.eval_training_render=true is the new param to render training distribution

@Victorbares
Victorbares marked this pull request as ready for review August 27, 2026 12:36
init_mode: create_all_valid
# Enable computation of evaluation-only metrics
compute_eval_metrics: false
# Evaluate and render scenarios using the saved Gigaflow training distribution.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove "saved Gigaflow"

Comment on lines +145 to +146
unsigned char partner_blindness_active;
unsigned char phantom_braking_active;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be derived from counter variable

Comment on lines +490 to +491
agent->partner_blindness_active = 0;
agent->phantom_braking_active = 0;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be derived from counter variable

static void generate_traffic_light_states(Drive *env) {
int steps = env->scenario_length;
float dt = env->dt;
int use_training_behavior = !env->eval_mode || env->eval_training_render;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

call it training_mode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants