pub struct VisionConfig {
pub image_size: usize,
pub patch_size: usize,
pub hidden_size: usize,
pub intermediate_size: usize,
pub num_hidden_layers: usize,
pub num_attention_heads: usize,
pub layer_norm_eps: f64,
pub scale_factor: usize,
pub image_token_id: u32,
}Expand description
Vision-encoder hyperparameters parsed from config.json::vision_config
(plus top-level scale_factor / image_token_id).
Fields§
§image_size: usizeSquare input image size (pixels).
patch_size: usizePatch size (pixels) of the patch embedding.
Vision hidden size.
intermediate_size: usizeVision MLP intermediate size.
Vision transformer layers.
num_attention_heads: usizeVision attention heads (MHA — kv heads == q heads).
layer_norm_eps: f64LayerNorm epsilon (SigLIP: 1e-6).
scale_factor: usizePixel-shuffle scale factor of the connector (scale² patches are merged into one visual token).
image_token_id: u32Token id whose span in the prompt is replaced by visual embeddings.
Implementations§
Source§impl VisionConfig
impl VisionConfig
Trait Implementations§
Source§impl Clone for VisionConfig
impl Clone for VisionConfig
Source§fn clone(&self) -> VisionConfig
fn clone(&self) -> VisionConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for VisionConfig
impl RefUnwindSafe for VisionConfig
impl Send for VisionConfig
impl Sync for VisionConfig
impl Unpin for VisionConfig
impl UnsafeUnpin for VisionConfig
impl UnwindSafe for VisionConfig
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