//! # sleepfm-rs — SleepFM Foundation Model inference in Rust
//!
//! Pure-Rust inference for the SleepFM (Sleep Foundation Model) for
//! polysomnography (PSG) signals, built on [Burn 0.20](https://burn.dev).
//!
//! SleepFM is a contrastive multi-modal sleep model that uses a
//! SetTransformer architecture to process variable-channel PSG inputs
//! (EEG/EOG, Respiratory, ECG/EKG, EMG) into fixed-size embeddings.
//!
//! ## Architecture
//!
//! 1. **Tokenizer**: 6-layer 1D CNN converts raw signal patches (640 samples = 5s @ 128Hz)
//!    into 128-dim tokens
//! 2. **Spatial pooling**: Attention pooling across channels per time step
//! 3. **Positional encoding**: Sinusoidal encoding + LayerNorm
//! 4. **Transformer encoder**: 6 pre-norm transformer layers for temporal modelling
//! 5. **Temporal pooling**: Attention pooling across time → single embedding vector
//!
//! ## Quick start
//!
//! ```rust,ignore
//! use sleepfm::SleepFmEncoder;
//!
//! let (encoder, _ms) = SleepFmEncoder::<B>::load(
//!     Path::new("config.json"),
//!     Path::new("model.safetensors"),
//!     device,
//! )?;
//! ```

pub mod config;
pub mod encoder;
pub mod model;
pub mod weights;

// Flat re-exports
pub use encoder::{SleepFmEncoder, ModalityEmbedding, EncodingResult};
pub use config::ModelConfig;
