Skip to content

Comments

Add VecNormalize support to evaluate_with_forward_vel function#73

Merged
kuds merged 2 commits intomainfrom
claude/fix-raptor-runtime-error-SdVg5
Feb 22, 2026
Merged

Add VecNormalize support to evaluate_with_forward_vel function#73
kuds merged 2 commits intomainfrom
claude/fix-raptor-runtime-error-SdVg5

Conversation

@kuds
Copy link
Owner

@kuds kuds commented Feb 22, 2026

This pull request updates the evaluation logic for trained policies in the notebooks/brachiosaurus_training.ipynb notebook to ensure that observations are normalized during evaluation, matching the input distribution used during training. This helps produce more reliable and consistent evaluation results.

Evaluation improvements:

  • The evaluate_trained_policy function now accepts an optional vecnorm_path parameter. If provided, it loads saved VecNormalize statistics and uses them to normalize observations during evaluation, ensuring consistency with training-time normalization.
  • The evaluation call for the final Stage 3 policy now passes the vecnorm_path argument, activating observation normalization for this stage.

Resource management:

  • The code now properly closes the VecNormalize object after evaluation to free up resources.

The evaluate_with_forward_vel and evaluate_trained_policy functions were
creating raw RaptorEnv instances without VecNormalize, so the trained model
received unnormalized observations and produced garbage actions. This caused
the curriculum gate check to always fail despite the training curves showing
the model had learned successfully.

Add vecnorm_path parameter to both functions and normalize observations
using the saved VecNormalize stats, matching what record_stage_video
already does correctly.

https://claude.ai/code/session_011tUK1ofRqTfnLTTNXLvQzR
Apply the same fix from the velociraptor notebook to the brachiosaurus
and trex training notebooks. Both had evaluate_with_forward_vel and
evaluate_trained_policy using raw unnormalized observations, causing
the curriculum gate and final evaluation to produce garbage results.

https://claude.ai/code/session_011tUK1ofRqTfnLTTNXLvQzR
@kuds kuds merged commit bf0b930 into main Feb 22, 2026
2 checks passed
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