jgrusewski
825db90f23
feat: comprehensive DQN training pipeline overhaul — 16 bug fixes, MSE warmup, financial metrics
Major fixes:
- C51 v_range calibrated for reward v4 (±2.0, was ±25/±0.5)
- Wrong Flat index in Q-gap filter (qe[4]→qe[2] in branching_action_select)
- hold_time tracks total position duration (was only losing bars)
- Entropy coefficient wired to C51 backward kernel (0.001, was unwired)
- Count bonus wired to GPU action selection (per-branch UCB)
- Q-gap warmup ramp (0→threshold over 5 epochs, was static)
- IQN lambda gradient scaling (max_grad_norm × (1+lambda))
- PER beta annealing 4x faster (500 steps, was 2000)
- Reward normalization disabled (scrambled per-bar returns)
- Capital floor uses natural return (was hardcoded -1.0)
- Financial metrics pipeline: real per-trade GPU stats (was Trades=1)
New features:
- MSE loss CUDA kernel for C51 warmup phase
- Blended MSE→C51 loss with linear alpha ramp
- GPU trade_stats_reduce kernel for per-trade financial metrics
- TradeStats struct with real win/loss/PF from portfolio states
- Behavioral smoke test (Q-values, action entropy, trades)
- 50-epoch convergence test with anomaly detection
- c51_warmup_epochs in hyperopt search space (41D)
Dead code removed:
- portfolio_sim_kernel (150 lines CUDA)
- DSR/PnL/drawdown reward v2 computations
- 7 dead kernel params from env_step signature
- GpuPortfolioSimulator (never called)
- Reward normalization block + state fields
0 warnings, 0 errors, 1241 unit tests + 8 smoke tests pass.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 21:48:38 +01:00
..
2025-10-30 01:26:02 +01:00
2025-09-24 23:47:21 +02:00
2025-09-24 23:47:21 +02:00
2026-03-22 01:40:16 +01:00
2026-03-21 23:35:41 +01:00
2026-03-02 15:13:40 +01:00
2026-03-04 23:46:36 +01:00
2025-09-24 23:47:21 +02:00
2025-09-24 23:47:21 +02:00
2025-09-24 23:47:21 +02:00
2026-03-24 21:48:38 +01:00
2025-11-28 10:29:45 +01:00
2025-09-24 23:47:21 +02:00
2025-10-18 18:14:34 +02:00
2025-10-14 18:41:48 +02:00
2025-09-24 23:47:21 +02:00
2025-09-24 23:47:21 +02:00
2025-10-30 01:26:02 +01:00
2025-09-24 23:47:21 +02:00
2025-11-28 10:29:45 +01:00
2026-03-07 13:00:07 +01:00
2026-03-07 12:19:46 +01:00
2026-02-23 20:02:38 +01:00