- Wire GpuReplayBuffer into DQN constructor with OOM fallback to CPU PER - Fix P0: GPU PER priorities never updated in single-batch train_step() (result.indices was empty CPU Vec; GPU tensors td_errors_gpu/indices_gpu were silently dropped) - Fix IS-weight ordering: apply weights AFTER Huber loss, not before (weighting before nonlinear Huber shifts quadratic/linear regime boundary) - Fix IQN CVaR: add .contiguous() before sort_last_dim (341/341 tests pass) - Defer loss scalar readback to after backward pass (piggyback on grad flush) - Add next_states to ExperienceBatch with episode-aware shift computation - Add insert_batch_tensors() for direct GPU tensor insertion into replay buffer - Make Q-value estimation periodic (every 50 steps) to reduce forward passes - Fix CPU fallback path types (u8 action, i32 fixed-point reward, timestamp) 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;