Files
ruvnet--RuView/v2/crates/wifi-densepose-train/Cargo.toml
T
ruv 7d26b15eef feat(train): MERIDIAN-MAE — csi_mae::model + pretrain loop + pretrain-mae bin (iter 2b, #68)
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>
2026-05-11 13:05:27 -04:00

97 lines
2.4 KiB
TOML

[package]
name = "wifi-densepose-train"
version = "0.3.0"
edition = "2021"
authors = ["rUv <ruv@ruv.net>", "WiFi-DensePose Contributors"]
license = "MIT OR Apache-2.0"
description = "Training pipeline for WiFi-DensePose pose estimation"
repository = "https://github.com/ruvnet/wifi-densepose"
documentation = "https://docs.rs/wifi-densepose-train"
keywords = ["wifi", "training", "pose-estimation", "deep-learning"]
categories = ["science", "computer-vision"]
readme = "README.md"
[[bin]]
name = "train"
path = "src/bin/train.rs"
[[bin]]
name = "verify-training"
path = "src/bin/verify_training.rs"
required-features = ["tch-backend"]
[[bin]]
name = "pretrain-mae"
path = "src/bin/pretrain_mae.rs"
required-features = ["tch-backend"]
[features]
default = []
tch-backend = ["tch"]
cuda = ["tch-backend"]
[dependencies]
# Internal crates
wifi-densepose-signal = { version = "0.3.0", path = "../wifi-densepose-signal", default-features = false }
wifi-densepose-nn = { version = "0.3.0", path = "../wifi-densepose-nn" }
# Core
thiserror.workspace = true
anyhow.workspace = true
serde = { workspace = true, features = ["derive"] }
serde_json.workspace = true
# Tensor / math
ndarray.workspace = true
num-complex.workspace = true
num-traits.workspace = true
# PyTorch bindings (optional — only enabled by `tch-backend` feature)
tch = { workspace = true, optional = true }
# Graph algorithms (min-cut for optimal keypoint assignment)
petgraph.workspace = true
# ruvector integration (subpolynomial min-cut, sparse solvers, temporal compression, attention)
ruvector-mincut = { workspace = true }
ruvector-attn-mincut = { workspace = true }
ruvector-temporal-tensor = { workspace = true }
ruvector-solver = { workspace = true }
ruvector-attention = { workspace = true }
# Data loading
ndarray-npy.workspace = true
memmap2 = "0.9"
walkdir.workspace = true
# Serialization
csv.workspace = true
toml = "0.8"
# Logging / progress
tracing.workspace = true
tracing-subscriber.workspace = true
indicatif.workspace = true
# Async (subset of features needed by training pipeline)
tokio = { workspace = true, features = ["rt", "rt-multi-thread", "macros", "fs"] }
# Crypto (for proof hash)
sha2.workspace = true
# CLI
clap.workspace = true
# Time
chrono = { version = "0.4", features = ["serde"] }
[dev-dependencies]
criterion.workspace = true
proptest.workspace = true
tempfile = "3.10"
approx = "0.5"
[[bench]]
name = "training_bench"
harness = false