Phase 1: Remove artificial caps - TFT benchmark: VRAM-scaled batch sizes (4/16/32/64) replacing hardcoded max_batch=4 - Liquid CUDA: VRAM-aware config defaults (batch 256-2048, pool 10% VRAM) - DQN trainer: remove double-clamp between AutoBatchSizer and HardwareBudget Phase 2: Mixed precision in training - DQN agent: add BF16/FP16 dtype casting in forward_with_gradients and forward_without_gradients (training was bypassing forward_mixed) Phase 3: Reduce CPU round-trips - DQN trainer: flat buffer select_actions_batch (eliminate Vec<Vec<f32>>) - DQN trainer: early-skip experience extraction (avoid .to_vec() on invalid) - EpochPrefetcher: AtomicBool is_ready() so callers can detect completion Phase 4: Adaptive scaling - HardwareBudget: tiered safety factor (0.70-0.85 by GPU size) - AutoBatchSizer: VRAM-proportional batch_overhead_mb (1.5% instead of fixed 250MB) 2451 tests pass, 0 clippy warnings. 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;