4 bugs found by deep investigation agents: 1. HIGH: minimum_profit_factor (search dim 30) was never forwarded from DQNHyperparameters to DQNConfig — trainer hardcoded 1.5, making the entire dimension wasted. Added field to DQNHyperparameters, wired through trainer.rs. 2. HIGH: Backtest EvaluationEngine used hardcoded $10K initial capital while training used $35K (self.initial_capital). Returns/Sharpe were 3.5x distorted. Now uses self.initial_capital. 3. MEDIUM: calculate_hft_activity_score_wave10 multiplied already-100x buy_pct/sell_pct by 100 again, making the diversity penalty threshold (15%) unreachable (values were ~2700). Removed double multiplication. 4. MEDIUM: Sortino ratio returned 0.0 for all-positive returns (no downside deviation), penalizing perfect strategies in the 40%-weighted composite score. Now returns 100.0 (capped) when mean return > 0. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ml
10-model ML ensemble for the Foxhunt HFT system, built on Candle v0.9.1.
Models
- DQN (Rainbow) — deep Q-network with prioritized replay, dueling heads, noisy nets
- PPO — proximal policy optimization with GAE, LSTM policies, clip-higher
- TFT — temporal fusion transformer for multi-horizon forecasting
- Mamba2 — state space model for sequence prediction
- Liquid Networks — biologically inspired networks for non-stationary data
- TLOB — transformer-based limit order book analysis
- KAN — Kolmogorov-Arnold networks
- xLSTM — extended LSTM architecture
- TGGN — temporal graph neural network
- Diffusion — diffusion-based generative model
Key Modules
ensemble— model ensemble coordination and confidence aggregationhyperopt— PSO-based hyperparameter optimization with per-model adapterstrainers— unified training loops (DQN, PPO, supervised)inference—InferenceAdaptertrait for predictioncheckpoint— model checkpointing and restorationevaluation— walk-forward evaluation pipeline
Usage
use ml::dqn::DQN;
use ml::ppo::PpoTrainer;