pub struct SamEncoderConfig {
pub encoder_kind: EncoderKind,
pub embed_dim: usize,
pub depth: usize,
pub num_heads: usize,
pub global_attn_indexes: Vec<usize>,
pub window_size: usize,
pub use_rel_pos: bool,
pub use_abs_pos: bool,
pub qkv_bias: bool,
pub layer_norm_eps: f64,
pub out_chans: usize,
}Expand description
Encoder configuration — ViT-B/L/H or TinyViT variants.
Fields§
§encoder_kind: EncoderKind§embed_dim: usize§depth: usize§num_heads: usize§global_attn_indexes: Vec<usize>Per-block flag: blocks listed here use global attention
(no windowing); all others use windowed attention with
window_size.
window_size: usize§use_rel_pos: bool§use_abs_pos: bool§qkv_bias: bool§layer_norm_eps: f64LayerNorm eps used throughout the encoder.
out_chans: usizeChannel count of the final image embeddings (after the neck).
Implementations§
Trait Implementations§
Source§impl Clone for SamEncoderConfig
impl Clone for SamEncoderConfig
Source§fn clone(&self) -> SamEncoderConfig
fn clone(&self) -> SamEncoderConfig
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 moreSource§impl Debug for SamEncoderConfig
impl Debug for SamEncoderConfig
Source§impl<'de> Deserialize<'de> for SamEncoderConfig
impl<'de> Deserialize<'de> for SamEncoderConfig
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SamEncoderConfig
impl RefUnwindSafe for SamEncoderConfig
impl Send for SamEncoderConfig
impl Sync for SamEncoderConfig
impl Unpin for SamEncoderConfig
impl UnsafeUnpin for SamEncoderConfig
impl UnwindSafe for SamEncoderConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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