Files
foxhunt/crates/ml
jgrusewski bfd2253a9d fix: wire real GPU backprop + SPSA gradients, fix checkpoint loading, eliminate candle from examples
- GpuAdamW: add grad_scale param to CUDA kernel — gradient clipping was computed but never applied
- PPO load_checkpoint: load .actor.bin/.critic.bin weights (was Xavier re-init with TODO)
- CudaLinear::set_weights(): new method for checkpoint weight import
- TLOB/KAN/TGGN/Liquid backward: real GPU backprop via GpuLinear::backward() + GpuAdamW
- Mamba2 backward: SPSA gradient estimation replacing random pseudo-gradients (Spall 1992)
- Mamba2 adapter: wire SPSA backward with GPU-cached input/target/loss tensors
- TFT/xLSTM/Diffusion backward: explicit errors routing to native train() methods
- TLOB load_checkpoint: load .weights.json via GpuVarStore::import_from_host()
- train_baseline_supervised: 30 candle→native API fixes (Tensor/Device eliminated)
- evaluate_baseline: 38 candle→native API fixes (DQN/PPO/supervised GPU eval paths)
- evaluate_supervised: candle→native fixes (forward_loss instead of forward+compute_loss)
- cuda_test: rewrite to cudarc 0.19 (MlDevice, CudaSlice, memcpy)
- train_baseline_rl: Device→CudaContext for GPU double-buffer
- hyperopt_baseline_rl: CudaContext→MlDevice::cuda() for device pool
- xLSTM deterministic test: fix for stateful LSTM (hidden state changes between predictions)
- Liquid early stopping test: deterministic data for reliable convergence
- Mamba2Config: add spsa_epsilon field (default 0.01, serde backward-compatible)
- Clean stale candle comments from trainer, inference_validator, mamba optimizer

1853 tests pass (302+359+168+169+855), 0 failures, 0 clippy warnings, 8/8 examples compile.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 15:41:42 +01:00
..

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 aggregation
  • hyperopt — PSO-based hyperparameter optimization with per-model adapters
  • trainers — unified training loops (DQN, PPO, supervised)
  • inferenceInferenceAdapter trait for prediction
  • checkpoint — model checkpointing and restoration
  • evaluation — walk-forward evaluation pipeline

Usage

use ml::dqn::DQN;
use ml::ppo::PpoTrainer;