Real CSI masked-autoencoder behind feature `tch-backend` (ADR-027 §2.0):
- CsiMae: dual-stream per-token amp+phase embed → fuse → residual-MLP encoder
over the visible tokens → flatten-to-latent bottleneck → learned per-position
query + broadcast latent → residual-MLP decoder → dec_amp_head / dec_ph_head
→ index_select the masked positions. (MLP-based v0; self-attention transformer
blocks are iter 3.)
- CsiMae::reconstruction_loss(pred_amp, pred_phase, tgt_amp, tgt_phase, phase_w)
= MSE(amp) + phase_w * MSE(phase).
- MaeBatch::from_windows — partition computed once from window 0 and reused
across the batch (the bottleneck fixes n_tokens), ndarray → tch conversion.
- pretrain_step(model, opt, batch) -> f64 — one Adam step, returns the loss.
- src/bin/pretrain_mae.rs — synthetic-data pre-train driver (required-features
= ["tch-backend"]); clap args for epochs/batch/samples/lr/mask-ratio/save.
- #[cfg(feature="tch-backend")] smoke test: loss halves when overfitting one
batch over 60 steps; also asserts model.n_visible/n_masked match
mask_csi_window's clamping.
v0 limits (documented in the module): fixed n_tokens; batch-shared masking;
MSE on unwrapped phase (vs a circular loss). The dev box has no LibTorch, so the
tch path is CI-verified (`--features tch-backend`), not locally. The default
`cargo test -p wifi-densepose-train --no-default-features` stays green (121 lib
tests) — the model module and the bin are both feature-gated.
Co-Authored-By: claude-flow <ruv@ruv.net>