Skip to main content

reve_rs/
lib.rs

1//! # reve-rs — REVE EEG Foundation Model inference in Rust
2//!
3//! Pure-Rust inference for the REVE (Representation for EEG with Versatile
4//! Embeddings) foundation model, built on [RLX](https://github.com/eugenehp/rlx)
5//! (`rlx-cpu` by default; optional `rlx-metal`, `rlx-mlx`, …).
6//!
7//! REVE generalizes across diverse electrode configurations using 4D positional
8//! encoding (x, y, z, t). It was pretrained on 60,000+ hours of EEG data from
9//! 92 datasets spanning 25,000 subjects.
10//!
11//! ## Quick start
12//!
13//! ```rust,ignore
14//! use reve_rs::ReveEncoder;
15//! use rlx::Device;
16//! use std::path::Path;
17//!
18//! let (mut model, _ms) = ReveEncoder::load(
19//!     Path::new("data/config.json"),
20//!     Path::new("data/model.safetensors"),
21//!     Device::Cpu,
22//! )?;
23//! let out = model.run_one(signal, positions_xyz, n_channels, n_times)?;
24//! ```
25
26#[cfg(not(feature = "rlx"))]
27compile_error!("enable the `rlx` feature (enabled by default)");
28
29pub mod config;
30
31#[cfg(feature = "rlx")]
32pub mod rlx;
33
34pub mod position_bank;
35
36pub use config::ModelConfig;
37pub use position_bank::PositionBank;
38
39#[cfg(feature = "rlx")]
40pub use rlx::{EncodingResult, ReveEncoder, ReveOutput};