Skip to main content

Encoder

Trait Encoder 

Source
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:

§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 a Tensor<B, 4> (images) or Tensor<B, 5> (video). Higher-level wrappers may accept Representation<B> so that levels in a hierarchy can chain.

Required Associated Types§

Source

type Input

The type of input this encoder accepts.

Required Methods§

Source

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]

Source

fn embed_dim(&self) -> usize

Get the output embedding dimension.

Implementors§