# embeddings are L2-normalized, so cosine similarity is just a dot productimport numpy as npsim = embeddings @ embeddings.Ttop5 = np.argpartition(-sim, 5, axis=1)[:, :5] # 5 nearest for each epoch
# Compute once at the highest dim and slice laterfull = model.embed(eeg, sfreq=256, channel_names=ch_names, dim=768)compact = full[:, :48] / np.linalg.norm(full[:, :48], axis=1, keepdims=True)
Non-overlapping epochs (for classification with epoch-level labels)
# Default is a 1s sliding window. For one embedding per 30s window:embeddings = model.embed(eeg, sfreq=256, channel_names=ch_names, dim=192, stride_seconds=30.0)