Complete temporal causal bottleneck implementation across all GPU paths: Experience collector (data collection): - Loads bn_tanh_concat_kernel from utility cubin - Bottleneck GEMM + tanh + concat runs per timestep before Q-forward - Same 2D compression as training → consistent Q-values for action selection - Buffers: exp_bn_hidden [N, bn_dim], exp_bn_concat [N, concat_dim] Backward pass (gradient kernels): - bn_tanh_backward_kernel: d_bn = d_concat * (1 - tanh^2) Reads saved tanh values from forward, applies derivative - bn_bias_grad_kernel: db_bn = sum(d_bn, dim=0) via atomicAdd - dW_bn via cuBLAS launch_dw_only: d_bn^T @ states[:, :market_dim] - All gradients accumulate into grad_buf at tensors 20-21 The 2D bottleneck is now end-to-end: Forward: states → W_bn GEMM → tanh → concat → h_s1 → ... → Q-values Backward: d_logits → ... → d_h_s1 → d_concat → d_bn (tanh') → dW_bn, db_bn Experience: states → bottleneck → Q-forward → action selection → env step Set bottleneck_dim=2 to enable. Default: 0 (disabled, backward compatible). Co-Authored-By: Claude Opus 4.6 (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;