diff --git a/ml/src/hyperopt/adapters/dqn.rs b/ml/src/hyperopt/adapters/dqn.rs index fe5d5d192..12f029842 100644 --- a/ml/src/hyperopt/adapters/dqn.rs +++ b/ml/src/hyperopt/adapters/dqn.rs @@ -408,10 +408,11 @@ impl DQNTrainer { early_stopping_plateau_window: 5, // Default: 5 epochs (hyperopt optimized) early_stopping_min_epochs: 1000, // Default: 1000 (effectively disabled - Wave 7 validation) trial_counter: 0, // Start at trial 0 - // WAVE 16 (Agent 38): Switched to Hard updates for stability - tau: 1.0, // Hard updates use full copy - target_update_mode: crate::trainers::TargetUpdateMode::Hard, // Hard updates (Stable Baselines3) - target_update_frequency: 10000, // Stable Baselines3 standard: 10K steps + // FIX: Enable soft updates (root cause of gradient explosion) + // Hard updates were causing 10K-16K gradient norms (Wave 16H baseline: 1,707) + tau: 0.001, // Soft updates: 0.1% target blend per step (Rainbow DQN standard) + target_update_mode: crate::trainers::TargetUpdateMode::Soft, // Soft updates prevent Q-value explosion + target_update_frequency: 1, // Update every step with soft blending enable_preprocessing: true, // Preprocessing enabled by default (Wave 14) preprocessing_window: 50, // Default: 50-bar rolling window preprocessing_clip_sigma: 5.0, // Default: clip at ±5σ