Skip to main content

Crate sensorlm

Crate sensorlm 

Source
Expand description

§sensorlm-rs

A complete Rust implementation of the SensorLM sensor-language foundation model (NeurIPS 2025) using the Burn 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:

cargo build --features wgpu

§Architecture overview

                       ┌────────────────────────────────────────┐
  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) │  └─────────────────┘│
                        │  └──────────────┘                      │
                        └────────────────────────────────────────┘

Modules§

config
Hierarchical configuration structs for every subsystem.
constants
Physical constants, feature lists, and normalisation parameters.
data
Data pipeline: loading, preprocessing, download, and caption generation.
error
Crate-wide error types.
inference
Inference utilities.
loss
SigLIP sigmoid contrastive loss.
model
Model architecture for SensorLM.
quantization
Model quantisation.
training
Training infrastructure.

Type Aliases§

CpuBackend
NdArray (CPU) backend for inference and testing.
CpuTrainBackend
Autodiff wrapper over NdArray for CPU training / unit tests.