Algorithmic property test (CPU). Confirms Thompson exploration discovers KNOWN +0.005 edge in 100 iterations on a 1-state bandit, while argmax-only training never updates Q[Long]. Setup revised from plan A draft (option 3 — production-realistic): p_long initial = [0.10, 0.20, 0.40, 0.20, 0.10] (uniform, E=0, has σ) p_flat initial = [0, 0, 1, 0, 0] (δ(v=0), deterministic) Argmax with strict-> ties at E=0 → always picks Flat → never explores Long → Q[Long] stays at 0, never discovers edge. Thompson samples Long > 0 with P≈0.30 → ~30 effective updates → mean drifts toward +0.005, crosses Q[Flat]=0 within budget. Plan's prior draft (initial p_long with mean=-0.015 + p_flat=δ(0)) was calibration-bound: Thompson drift was directionally correct (-0.015 → -0.005) but didn't cross zero in 100 iters. Revised setup eliminates the artificial initial bias and matches production reality more closely (Flat = δ(0) by construction; Long starts spread from random init, then accumulates true edge). Stop condition: if Thompson e_long ≤ e_flat with this setup, the hypothesis is genuinely wrong and reward shaping must change before proceeding to Phase 2. Observed (local RTX 3050 Ti, ~0.00s test wall, ~1.57s 5-test suite): argmax : e_long=0.000000, e_flat=0.000000 (asserts e_long ≤ 0.001 OK) thompson: e_long=0.003550, e_flat=0.000000 (asserts e_long > e_flat OK) All 5 Phase 0 tests pass: 0.A bias-reproduces, 0.B inverse-CDF, 0.C IQN symmetry, 0.D Thompson-reverses, 0.E synthetic-edge.
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;