Skip to main content

Crate zuna_rs

Crate zuna_rs 

Source
Expand description

§zuna-rs — ZUNA EEG Foundation Model inference in Rust

Pure-Rust inference for the ZUNA EEG foundation model. Two inference engines are available behind Cargo features:

featuremoduleruntime
burncrate root (ZunaEncoder, …)Burn 0.20
rlxrlxRLX compiler/runtime

FIF preprocessing is shared (preprocess_fif_cpu) via exg.

§Backends

Burn (with --features burn,ndarray): ndarray, blas-accelerate, wgpu, burn-mlx / mlx.

RLX (with --features rlx): cpu, metal, mlx, gpu, cuda, rocm, tpu, and BLAS variants.

Compare both engines (add --features burn,ndarray for the Burn side):

cargo run --example backend_compare --release \
    --no-default-features \
    --features burn,rlx,ndarray,rlx-cpu,rlx-metal,metal,wgpu,mlx,rlx-mlx

Re-exports§

pub use rlx::EpochEmbedding;
pub use rlx::EpochOutput;
pub use rlx::InferenceResult;
pub use rlx::ZunaDecoder;
pub use rlx::ZunaEncoder;
pub use rlx::ZunaInference;
pub use config::DataConfig;
pub use config::InferConfig;
pub use config::ModelConfig;
pub use data::FifInfo;
pub use data::PreprocessedEpoch;
pub use data::PreprocessedFif;
pub use data::invert_reshape;
pub use data::preprocess_fif_cpu;
pub use channel_positions::MontageLayout;
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 csv_loader::CsvInfo;
pub use csv_loader::CsvLoadOptions;
pub use csv_loader::PaddingStrategy;
pub use csv_loader::load_from_csv;
pub use csv_loader::load_from_named_tensor;
pub use csv_loader::load_from_raw_tensor;
pub use csv_export::fif_to_csv;

Modules§

channel_positions
EEG channel position lookup from embedded standard montage files.
config
csv_export
Export FIF recordings to CSV files.
csv_loader
CSV and raw-tensor loading for ZUNA inference.
data
Data preparation for ZUNA inference.
rlx
RLX-backed ZUNA inference (rlx::Graph + rlx::Session).

Functions§

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