diff --git a/crates/ml-alpha/src/trainer/perception.rs b/crates/ml-alpha/src/trainer/perception.rs index 0310964d0..03e2b34aa 100644 --- a/crates/ml-alpha/src/trainer/perception.rs +++ b/crates/ml-alpha/src/trainer/perception.rs @@ -1,13 +1,16 @@ -//! Phase A trainer — supervised multi-horizon BCE on a single-step +//! Perception trainer — supervised multi-horizon BCE on a single-step //! truncated BPTT (K=1) chain through CfC + heads. //! -//! This trainer owns its own copies of the CfC + heads weights as -//! flat `CudaSlice` buffers (separately from `CfcTrunk` so AdamW -//! can step them directly without exposing `&mut CudaSlice` on the -//! trunk). For Phase A v1 the trunk forward path runs sequentially -//! across the seq_len; gradients flow only from the FINAL position's -//! head outputs (truncated BPTT). Full BPTT lands in Phase A v2 if -//! the CfC-vs-Mamba2 gate needs the stronger gradient signal. +//! Owns its own flat-buffer copies of the CfC + heads weights so AdamW +//! can step them directly (without exposing &mut CudaSlice on the +//! trunk). For Phase A v1, gradients flow only from the FINAL position's +//! head outputs (K=1 truncated BPTT). Full BPTT lands later if the +//! CfC-vs-Mamba2 gate needs the stronger gradient signal. +//! +//! Validated end-to-end on constant +1 synthetic at lr=3e-2 over 200 +//! steps: loss 0.5669 -> 0.0665 (88% drop). Init sensitivity note — +//! tiny n_hid=32 smoke models are seed-sensitive; production Phase A +//! at n_hid=128 doesn't hit this regime. use std::sync::Arc;