fix(ml): fix stale C2 defaults in trainer + clarify comments

- noisy_epsilon_floor fallback: 0.05 → 0.0 (C2: NoisyNet only)
- count_bonus_coefficient fallback: 0.1 → 0.0 (C2: disabled)
- use_count_bonus: true → false (C2: conflicts with NoisyNet)
- Fix 4 stale comments saying "REMOVED" → "FIXED to 0.0"

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
jgrusewski
2026-03-06 23:02:31 +01:00
parent 9fc1b629c4
commit 8f35c4f480
2 changed files with 9 additions and 9 deletions

View File

@@ -162,8 +162,8 @@ const MB_PER_SAMPLE: f64 = 0.0005;
/// DQN hyperparameter space (26D continuous -- exploration stacking removed)
///
/// C2 FIX: Reduced from 28D to 26D by removing exploration stacking:
/// - curiosity_weight: REMOVED (conflicts with NoisyNet primary exploration)
/// - noisy_epsilon_floor: REMOVED (NoisyNet handles exploration, epsilon floor redundant)
/// - curiosity_weight: FIXED to 0.0 (C2: conflicts with NoisyNet, not in search space)
/// - noisy_epsilon_floor: FIXED to 0.0 (C2: NoisyNet handles exploration, not in search space)
/// - entropy_coefficient: NARROWED from (0.05, 0.5) to (0.005, 0.05)
/// - count_bonus_coefficient: FIXED to 0.0 (was 0.1, conflicts with NoisyNet)
/// NoisyNet (sigma in network weights) is the sole primary exploration mechanism.
@@ -488,13 +488,13 @@ impl ParameterSpace for DQNParams {
// Volatility window (1D)
(10.0, 30.0), // 19: volatility_window
// Soft update (1D) — curiosity_weight REMOVED (C2: conflicts with NoisyNet)
// Soft update (1D) — curiosity_weight FIXED to 0.0 (C2: not in search space)
(0.005_f64.ln(), 0.01_f64.ln()), // 20: tau (log scale, Polyak soft update)
// GPU-dynamic network sizing (1D)
(256.0, 4096.0), // 21: hidden_dim_base (linear, step=256)
// noisy_epsilon_floor REMOVED (C2: NoisyNet handles exploration)
// noisy_epsilon_floor FIXED to 0.0 (C2: not in search space)
// CQL regularization (1D)
(0.0, 0.5), // 22: cql_alpha (linear)
@@ -551,7 +551,7 @@ impl ParameterSpace for DQNParams {
// GPU-dynamic hidden dims (C2: shifted from 22 to 21)
let hidden_dim_base = ((x[21].round() / 256.0).round() * 256.0).clamp(256.0, 4096.0) as usize;
// noisy_epsilon_floor REMOVED (C2: was index 23, NoisyNet handles exploration)
// noisy_epsilon_floor FIXED to 0.0 below (C2: was index 23, not in search space)
// CQL regularization (C2: shifted from 24 to 22)
let cql_alpha = x[22].clamp(0.0, 0.5);
@@ -3588,7 +3588,7 @@ mod tests {
assert_eq!(bounds[18], (0.1, 0.5)); // kelly_max_fraction
assert_eq!(bounds[19], (10.0, 30.0)); // volatility_window
// C2: curiosity_weight and noisy_epsilon_floor REMOVED from search space
// C2: curiosity_weight and noisy_epsilon_floor fixed to 0.0, not in search space
assert_eq!(bounds[21], (256.0, 4096.0)); // hidden_dim_base (was 22)
assert_eq!(bounds[22], (0.0, 0.5)); // cql_alpha (was 24)
}

View File

@@ -458,9 +458,9 @@ impl DQNTrainer {
weight_decay: hyperparams.weight_decay,
mixed_precision: hyperparams.mixed_precision.clone().or(mixed_precision_detected),
entropy_coefficient: hyperparams.entropy_coefficient.unwrap_or(0.01),
noisy_epsilon_floor: hyperparams.noisy_epsilon_floor.unwrap_or(0.05) as f32,
use_count_bonus: true,
count_bonus_coefficient: hyperparams.count_bonus_coefficient.unwrap_or(0.1),
noisy_epsilon_floor: hyperparams.noisy_epsilon_floor.unwrap_or(0.0) as f32, // C2: NoisyNet handles exploration
use_count_bonus: false, // C2: disabled (conflicts with NoisyNet)
count_bonus_coefficient: hyperparams.count_bonus_coefficient.unwrap_or(0.0), // C2: fixed to 0.0
};
// Create DQN agent