sensorlm-rs 0.1.0

SensorLM – wearable sensor foundation model in Rust (Burn + WGPU)
Documentation
//! # sensorlm-rs
//!
//! A complete Rust implementation of the **SensorLM** sensor-language foundation
//! model (NeurIPS 2025) using the [Burn](https://burn.dev) deep-learning framework.
//!
//! ## Backend selection
//!
//! By default this crate uses the **NdArray** (CPU) backend.  Enable the WGPU
//! (GPU) backend by building with the `wgpu` feature:
//!
//! ```bash
//! cargo build --features wgpu
//! ```
//!
//! ## Architecture overview
//!
//! ```text
//!                        ┌────────────────────────────────────────┐
//!   Raw wearable data    │             SensorLM (Two-Tower)       │
//!   (1440 × 34 × 1)      │                                        │
//!         │              │  ┌──────────────┐  SigLIP loss         │
//!         ▼              │  │ SensorEncoder│──────────────────┐   │
//!   Normalise / mask      │  │  (ViT-B/10/2)│                 │   │
//!         │              │  │  MAP pooling │                  │   │
//!         │              │  └──────────────┘  contrastive     │   │
//!         │              │         768-dim    alignment        │   │
//!         │              │                                     ▼   │
//!   Caption pipeline ──▶ │  ┌──────────────┐  ┌─────────────────┐│
//!   (stat/struct/semantic)│  │  TextEncoder │  │  temperature    ││
//!                         │  │  (Transformer│  │  + bias scalars ││
//!                         │  │   12 layers) │  └─────────────────┘│
//!                         │  └──────────────┘                      │
//!                         └────────────────────────────────────────┘
//! ```

#![warn(missing_docs, rustdoc::missing_crate_level_docs)]

pub mod config;
pub mod constants;
pub mod data;
pub mod error;
pub mod inference;
pub mod loss;
pub mod model;
pub mod quantization;
pub mod training;

// ---------------------------------------------------------------------------
// Backend type aliases
// ---------------------------------------------------------------------------

/// NdArray (CPU) backend for inference and testing.
pub type CpuBackend = burn::backend::NdArray;

/// Autodiff wrapper over NdArray for CPU training / unit tests.
pub type CpuTrainBackend = burn::backend::Autodiff<CpuBackend>;

// WGPU backend aliases (only available with `wgpu` feature).
#[cfg(feature = "wgpu")]
/// WGPU backend for GPU inference (no autodiff).
pub type WgpuBackend = burn::backend::Wgpu;

#[cfg(feature = "wgpu")]
/// Autodiff wrapper over WGPU for GPU training.
pub type TrainBackend = burn::backend::Autodiff<WgpuBackend>;