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. Two inference engines are available behind Cargo features:

featuremoduleruntime
burncrate root (LunaEncoder<B>, …)Burn 0.20
rlxrlxRLX compiler/runtime

LUNA 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.

§Backends

Burn (with --features burn,ndarray): ndarray, blas-accelerate, wgpu, metal, vulkan.

RLX (default): cpu, metal, mlx, gpu, cuda, rocm, tpu, and BLAS variants.

Re-exports§

pub use rlx::load_edf as rlx_load_edf;
pub use rlx::load_fif as rlx_load_fif;
pub use rlx::save_epochs as rlx_save_epochs;
pub use rlx::EpochEmbedding;
pub use rlx::LunaEncoder;
pub use rlx::PreprocInfo as RlxPreprocInfo;
pub use rlx::RlxEpoch;
pub use config::ModelConfig;
pub use channel_positions::bipolar_channel_xyz;
pub use channel_positions::channel_xyz;
pub use channel_positions::montage_channels;
pub use channel_positions::nearest_channel;
pub use channel_positions::normalise;
pub use channel_positions::MontageLayout;
pub use channel_vocab::channel_index;
pub use channel_vocab::channel_indices;
pub use channel_vocab::channel_indices_unwrap;
pub use channel_vocab::CHANNEL_VOCAB;
pub use channel_vocab::SEED_CHANNELS;
pub use channel_vocab::SIENA_CHANNELS;
pub use channel_vocab::TUEG_CHANNELS;
pub use channel_vocab::VOCAB_SIZE;

Modules§

channel_positions
EEG channel position lookup from embedded standard montage files.
channel_vocab
Global channel name vocabulary for LUNA.
config
rlx
RLX-backed LUNA inference (rlx::Graph + rlx::Session).

Functions§

init_threads
Configure the global Rayon thread pool (Burn NdArray + RLX CPU).