pub struct ModelConfig {
pub model_size: ModelSize,
pub feature_size: usize,
pub num_heads: usize,
pub num_layers: usize,
pub dim_feedforward: usize,
pub num_global_tokens: usize,
pub global_token_layer: usize,
pub num_channels: usize,
pub patch_size: usize,
pub conv_channels: [usize; 3],
pub norm_groups: [usize; 3],
pub layer_norm_eps: f64,
}Expand description
Full model configuration derived from model size.
All values match the Python EEG-DINO defaults exactly.
Fields§
§model_size: ModelSize§feature_size: usizeEmbedding dimension (d_model): 200 / 512 / 1024
num_heads: usizeNumber of attention heads: 8 / 16 / 24
num_layers: usizeNumber of transformer encoder layers: 12 / 12 / 24
dim_feedforward: usizeFeed-forward hidden dimension: 512 / 1024 / 2048
num_global_tokens: usizeNumber of learnable global tokens (default: 1)
global_token_layer: usizeLayer index (1-based) at which global tokens are injected (default: 1)
num_channels: usizeNumber of EEG channels (default: 19)
patch_size: usizeSamples per patch (default: 200)
conv_channels: [usize; 3]Conv channel widths for the 3 conv layers in proj_in: [c1, c2, c3]
norm_groups: [usize; 3]GroupNorm group counts for the 3 norm layers in proj_in
layer_norm_eps: f64LayerNorm epsilon
Implementations§
Source§impl ModelConfig
impl ModelConfig
pub fn from_size(size: ModelSize) -> Self
Sourcepub fn spectral_bins(&self) -> usize
pub fn spectral_bins(&self) -> usize
Number of spectral bins from rfft of patch_size samples: patch_size/2 + 1.
Sourcepub fn temporal_conv_out(&self) -> usize
pub fn temporal_conv_out(&self) -> usize
Temporal output dimension of the conv stack: floor((patch_size - 49 + 2*24) / 25) + 1.
Trait Implementations§
Source§impl Clone for ModelConfig
impl Clone for ModelConfig
Source§fn clone(&self) -> ModelConfig
fn clone(&self) -> ModelConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ModelConfig
impl Debug for ModelConfig
Source§impl<'de> Deserialize<'de> for ModelConfig
impl<'de> Deserialize<'de> for ModelConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for ModelConfig
impl RefUnwindSafe for ModelConfig
impl Send for ModelConfig
impl Sync for ModelConfig
impl Unpin for ModelConfig
impl UnsafeUnpin for ModelConfig
impl UnwindSafe for ModelConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more