Gate (4 tensors, [127..131)) + 8 experts × 4 tensors (32 tensors, [131..163)) appended to GpuDqnTrainer params_buf layout. NUM_WEIGHT_TENSORS 127 → 163. Layout fingerprint hash recomputes — old checkpoints fail to load with fingerprint-mismatch error per the no-fallback contract in the spec. Gate tensors: gate_w1[STATE_DIM=128,64], gate_b1[64], gate_w2[64,8], gate_b2[8]. Zero-init so g(s) = uniform 1/K at cold start. Expert tensors (per expert k∈[0,8)): w1[SH2,BTN], b1[BTN], w2[BTN,SH2], b2[SH2] where SH2=cfg.shared_h2=256, BTN=MOE_EXPERT_BOTTLENECK=64. Xavier init on w1/w2; zero on biases. Total ~268k new params. Adam state (m_buf/v_buf), gradient scratch, target_params_buf all extend in lockstep — all sized from compute_total_params() which sums over the full 163-tensor layout. No static sizes to update. Tensors allocated but not yet wired into forward/backward — Phase 3 wires gate forward, expert forward, mixture replacement of h_s2, and the corresponding backward chain. No test assert updates required — no test hardcodes NUM_WEIGHT_TENSORS or the layout fingerprint value. Spec: docs/superpowers/specs/2026-04-27-moe-regime-redesign-design.md §6.1. Co-Authored-By: Claude Opus 4.7 (1M context) <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;