- Add q_snapshot.rs: SnapshotRing ring buffer (MAX_SNAPSHOTS=5), health/q_gap admission gate - Add GpuDqnTrainer::maybe_snapshot_params() — DtoD copy of params_buf into snapshot slot - Add GpuDqnTrainer::apply_distillation_gradient() — two ungraphed saxpy_f32_aux calls: grad += alpha * (params - best_snapshot), alpha = 0.1 * (1 - health), skipped when health >= 0.99 - Wire FusedTrainingCtx::maybe_snapshot_qnet() / apply_distillation() / last_distill_active() - Call from process_epoch_boundary: snapshot when health >= 0.7, distill when health < 0.4 - No new CUDA kernel — reuses existing dqn_saxpy_f32_kernel (saxpy_f32_aux handle) Co-Authored-By: Claude Sonnet 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;