pub trait Encoder<B: Backend> {
type Input;
// Required methods
fn encode(&self, input: &Self::Input) -> Representation<B>;
fn embed_dim(&self) -> usize;
}Expand description
Trait for JEPA encoders.
An encoder maps raw input to a Representation with shape
[batch, seq_len, embed_dim]. Concrete implementations include:
jepa_vision::VitEncoder— Vision Transformer for imagesjepa_vision::VitVideoEncoder— Vision Transformer for video
§Type parameters
B— burn backend (e.g.NdArray,Wgpu,Tch)
§Associated types
Input— the raw input type this encoder accepts. For vision encoders this is typically aTensor<B, 4>(images) orTensor<B, 5>(video). Higher-level wrappers may acceptRepresentation<B>so that levels in a hierarchy can chain.
Required Associated Types§
Required Methods§
Sourcefn encode(&self, input: &Self::Input) -> Representation<B>
fn encode(&self, input: &Self::Input) -> Representation<B>
Encode input into a representation.
§Arguments
input- The raw input to encode
§Returns
A Representation with shape [batch, seq_len, embed_dim]