pub struct ViTConfig {
pub image_size: usize,
pub patch_size: usize,
pub in_channels: usize,
pub embed_dim: usize,
pub num_layers: usize,
pub num_heads: usize,
pub mlp_dim: usize,
pub num_classes: usize,
pub dropout: f32,
}Expand description
Vision Transformer configuration
Fields§
§image_size: usizeImage size (assumed square)
patch_size: usizePatch size (assumed square)
in_channels: usizeNumber of input channels
embed_dim: usizeEmbedding dimension
num_layers: usizeNumber of transformer layers
num_heads: usizeNumber of attention heads
mlp_dim: usizeMLP hidden dimension
num_classes: usizeNumber of output classes
dropout: f32Dropout rate
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ViTConfig
impl RefUnwindSafe for ViTConfig
impl Send for ViTConfig
impl Sync for ViTConfig
impl Unpin for ViTConfig
impl UnwindSafe for ViTConfig
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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