Files
ruvnet--RuView/v2/crates/wifi-densepose-train
ruv 99fea9df9b fix(adr-185): drop dead wifi-densepose-nn dep from train to slim [meridian] wheel
Root cause (investigated, same rigor as the MAT fix): `wifi-densepose-train`
declared `wifi-densepose-nn` as a dependency but NEVER imported it anywhere
in src/ or bin/ — a dead dependency. (The tch-backend model path uses the
`tch` crate directly, not wifi-densepose-nn; `grep -r wifi_densepose_nn
src/` returns nothing.) That dead dep pulled `ort` (ONNX Runtime) +
reqwest/hyper into every downstream consumer, including the ADR-185
`[meridian]` wheel, which binds only train's pure-compute geometry /
rapid_adapt / eval modules + signal::hardware_norm.

`cargo tree -i wifi-densepose-nn` confirmed train was the SOLE path pulling
nn into the wheel; after removal, the package is absent from the graph.

Fix: remove the dead dep line from train's Cargo.toml (no code change, no
feature-gating needed — nothing referenced it). Not a hoist: the coupling
turned out to be nonexistent, not deep.

Measured (maturin build --release --features meridian --strip):
  BEFORE: 1.8 MB   AFTER: 1.7 MB   (both already within the ADR-117 §5.4
  <=5 MB budget). Honest note: unlike MAT — which instantiates OnnxSession
  and thus bundles the ort native runtime (8.4 MB) — train never references
  ort, so the native lib was dead-stripped and the wheel was already under
  budget. The real win is removing ort/reqwest/hyper from train's dependency
  graph and compile for ALL consumers, not a dramatic wheel shrink.

Verified:
  cargo build -p wifi-densepose-train                       (default=[]) OK
  cargo tree -i wifi-densepose-nn  -> no longer in the graph
  cargo test --features meridian --test meridian_parity     2/2 pass
  maturin develop --features meridian + pytest test_meridian 13/13 pass
2026-07-21 17:30:33 -07:00
..

wifi-densepose-train

Crates.io Documentation License

Complete training pipeline for WiFi-DensePose, integrated with all five ruvector crates.

Overview

wifi-densepose-train provides everything needed to train the WiFi-to-DensePose model: dataset loading, subcarrier interpolation, loss functions, evaluation metrics, and the training loop orchestrator. It supports both the MM-Fi dataset (NeurIPS 2023) and deterministic synthetic data for reproducible experiments.

Without the tch-backend feature the crate still provides the dataset, configuration, and subcarrier interpolation APIs needed for data preprocessing and proof verification.

Features

  • MM-Fi dataset loader -- Reads the MM-Fi multimodal dataset (NeurIPS 2023) from disk with memory-mapped .npy files.
  • Synthetic dataset -- Deterministic, fixed-seed CSI generation for unit tests and proofs.
  • Subcarrier interpolation -- 114 -> 56 subcarrier compression via ruvector-solver sparse interpolation with variance-based selection.
  • Loss functions (tch-backend) -- Pose estimation losses including MSE, OKS, and combined multi-task loss.
  • Metrics (tch-backend) -- PCKh, OKS-AP, and per-keypoint evaluation with ruvector-mincut-based person matching.
  • Training orchestrator (tch-backend) -- Full training loop with learning rate scheduling, gradient clipping, checkpointing, and reproducible proofs.
  • All 5 ruvector crates -- ruvector-mincut, ruvector-attn-mincut, ruvector-temporal-tensor, ruvector-solver, and ruvector-attention integrated across dataset loading, metrics, and model attention.

Feature flags

Flag Default Description
tch-backend no Enable PyTorch training via tch-rs
cuda no CUDA GPU acceleration (implies tch)

Binaries

Binary Description
train Main training entry point
verify-training Proof verification (requires tch-backend)

Quick Start

use wifi_densepose_train::config::TrainingConfig;
use wifi_densepose_train::dataset::{SyntheticCsiDataset, SyntheticConfig, CsiDataset};

// Build and validate config
let config = TrainingConfig::default();
config.validate().expect("config is valid");

// Create a synthetic dataset (deterministic, fixed-seed)
let syn_cfg = SyntheticConfig::default();
let dataset = SyntheticCsiDataset::new(200, syn_cfg);

// Load one sample
let sample = dataset.get(0).unwrap();
println!("amplitude shape: {:?}", sample.amplitude.shape());

Architecture

wifi-densepose-train/src/
  lib.rs            -- Re-exports, VERSION
  config.rs         -- TrainingConfig, hyperparameters, validation
  dataset.rs        -- CsiDataset trait, MmFiDataset, SyntheticCsiDataset, DataLoader
  error.rs          -- TrainError, ConfigError, DatasetError, SubcarrierError
  subcarrier.rs     -- interpolate_subcarriers (114->56), variance-based selection
  losses.rs         -- (tch) MSE, OKS, multi-task loss        [feature-gated]
  metrics.rs        -- (tch) PCKh, OKS-AP, person matching     [feature-gated]
  model.rs          -- (tch) Model definition with attention    [feature-gated]
  proof.rs          -- (tch) Deterministic training proofs      [feature-gated]
  trainer.rs        -- (tch) Training loop orchestrator         [feature-gated]
Crate Role
wifi-densepose-signal Signal preprocessing consumed by dataset loaders
wifi-densepose-nn Inference engine that loads trained models
ruvector-mincut Person matching in metrics
ruvector-attn-mincut Attention-weighted graph cuts
ruvector-temporal-tensor Compressed CSI buffering in datasets
ruvector-solver Sparse subcarrier interpolation
ruvector-attention Spatial attention in model

License

MIT OR Apache-2.0