pub struct PatchEmbeddingConfig {
pub in_channels: usize,
pub patch_h: usize,
pub patch_w: usize,
pub embed_dim: usize,
}Expand description
Configuration for patch embedding.
§Example
use jepa_vision::patch::PatchEmbeddingConfig;
use burn_ndarray::NdArray;
use burn::prelude::*;
type B = NdArray<f32>;
let device = burn_ndarray::NdArrayDevice::Cpu;
let config = PatchEmbeddingConfig::new(3, 16, 16, 256);
let patch_embed = config.init::<B>(&device);
assert_eq!(patch_embed.num_patches(224, 224), 196);Fields§
§in_channels: usizeNumber of input channels (e.g., 3 for RGB).
patch_h: usizePatch height in pixels.
patch_w: usizePatch width in pixels.
embed_dim: usizeOutput embedding dimension.
Implementations§
Trait Implementations§
Source§impl Clone for PatchEmbeddingConfig
impl Clone for PatchEmbeddingConfig
Source§fn clone(&self) -> PatchEmbeddingConfig
fn clone(&self) -> PatchEmbeddingConfig
Returns a duplicate of the value. Read more
1.0.0 · 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 PatchEmbeddingConfig
impl Debug for PatchEmbeddingConfig
Source§impl<'de> Deserialize<'de> for PatchEmbeddingConfig
impl<'de> Deserialize<'de> for PatchEmbeddingConfig
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 PatchEmbeddingConfig
impl RefUnwindSafe for PatchEmbeddingConfig
impl Send for PatchEmbeddingConfig
impl Sync for PatchEmbeddingConfig
impl Unpin for PatchEmbeddingConfig
impl UnsafeUnpin for PatchEmbeddingConfig
impl UnwindSafe for PatchEmbeddingConfig
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