pub struct ModelConfig {
pub patch_size: usize,
pub num_queries: usize,
pub embed_dim: usize,
pub depth: usize,
pub num_heads: usize,
pub mlp_ratio: f64,
pub num_classes: usize,
pub drop_path: f64,
pub norm_eps: f64,
}Expand description
Model and runtime configuration for LUNA inference.
ModelConfig mirrors the Python LUNA hyperparameters.
Field names match the HuggingFace config.json "model" sub-object.
Fields§
§patch_size: usizePatch size in time-samples (default 40).
num_queries: usizeNumber of learned cross-attention queries (default 4).
embed_dim: usizePer-query / per-channel embedding dimension (default 64).
depth: usizeNumber of Rotary Transformer encoder blocks (default 8).
num_heads: usizeNumber of attention heads per transformer block.
Actual head count in the temporal encoder is num_heads * num_queries
because the effective dim is embed_dim * num_queries.
mlp_ratio: f64MLP expansion ratio inside transformer blocks (default 4.0).
num_classes: usizeNumber of output classes. 0 = reconstruction (pre-training).
drop_path: f64Drop-path rate for stochastic depth (default 0.0).
norm_eps: f64Layer normalisation epsilon (default 1e-5).
Implementations§
Source§impl ModelConfig
impl ModelConfig
Effective hidden dimension after query concatenation: embed_dim * num_queries.
FFN hidden dimension inside transformer blocks.
Sourcepub fn total_heads(&self) -> usize
pub fn total_heads(&self) -> usize
Total number of attention heads in the temporal encoder.
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 Default for ModelConfig
impl Default 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