Per spec §8.2 (3.3). penalty = λ_dd × max(0, dd_current − dd_threshold)² Asymmetric: zero below threshold, quadratic growth above. Encodes loss aversion per pearl_audit_unboundedness_for_implicit_asymmetry. 3 ISV slots: 420 LAMBDA_DD (initial 1.0; ISV-tracked from grad-balance in follow-up), 421 DD_THRESHOLD (initial 0.05 = 5% drawdown trigger), 422 DD_PENALTY_GRAD_NORM (initial 0.0). 3 fold-reset registry entries + dispatch arms. Per established Phase precedent: kernel + launcher land first; reward composition site (subtract penalty from r_total) deferred to follow-up commit per feedback_no_partial_refactor. Anchor test 2.5 drawdown_de_risks (Phase 2C / Phase 3.5 paired) — green via Phase 3.5 mechanisms; this commit lands the penalty primitive. 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;