Skip to main content

Crate luna_rs

Crate luna_rs 

Source
Expand description

§luna-rs — LUNA EEG Foundation Model inference in Rust

Pure-Rust inference for the LUNA (Latent Unified Network Architecture) EEG foundation model, built on Burn 0.20.

LUNA is a topology-agnostic EEG model that uses cross-attention with learned queries to compress variable-channel inputs into a fixed-size latent space, then processes them with a Rotary Transformer encoder.

§Quick start

use luna_rs::LunaEncoder;

let (model, _ms) = LunaEncoder::<B>::load(
    Path::new("config.json"),
    Path::new("model.safetensors"),
    device,
)?;

Re-exports§

pub use encoder::LunaEncoder;
pub use encoder::EpochEmbedding;
pub use encoder::EncodingResult;
pub use config::ModelConfig;
pub use config::DataConfig;
pub use data::InputBatch;
pub use data::FifInfo;
pub use data::build_batch_named;
pub use channel_positions::channel_xyz;
pub use channel_positions::bipolar_channel_xyz;
pub use channel_positions::MontageLayout;
pub use channel_positions::montage_channels;
pub use channel_positions::nearest_channel;
pub use channel_positions::normalise;
pub use channel_vocab::CHANNEL_VOCAB;
pub use channel_vocab::VOCAB_SIZE;
pub use channel_vocab::channel_index;
pub use channel_vocab::channel_indices;
pub use channel_vocab::channel_indices_unwrap;
pub use channel_vocab::TUEG_CHANNELS;
pub use channel_vocab::SIENA_CHANNELS;
pub use channel_vocab::SEED_CHANNELS;
pub use csv_loader::load_from_csv;
pub use csv_loader::CsvInfo;
pub use preprocessing::load_edf;
pub use preprocessing::load_fif;
pub use preprocessing::load_luna_epochs;
pub use preprocessing::load_csv_and_preprocess;
pub use preprocessing::PreprocInfo;

Modules§

channel_positions
EEG channel position lookup from embedded standard montage files.
channel_vocab
Global channel name vocabulary for LUNA.
config
csv_loader
CSV loader for EEG data.
data
encoder
Standalone LUNA encoder — produce latent EEG embeddings.
model
preprocessing
End-to-end EEG preprocessing for LUNA inference.
quantize
INT8 post-training quantization for LUNA.
weights