class

GS::MASt3R::Encoder

Inherits Reference < Object

MASt3R encoder: processes image pair with shared ViT + cross-attention

Constructors

new(config : EncoderConfig, device : Tensor::Device = Tensor::Device::GPU)
Source

Instance methods

blocks
Source
cls_token

Learnable embeddings

Source
config
Source
forward_pair(x1 : Autograd::Variable, x2 : Autograd::Variable) : Tuple(Autograd::Variable, Autograd::Variable)

Encode image pair with cross-attention x1, x2: [batch, channels, height, width] Returns: tuple of [batch, num_patches + 1, embed_dim] for each image

Source
forward_single(x : Autograd::Variable) : Autograd::Variable

Encode single image x: [batch, channels, height, width] Returns: [batch, num_patches + 1, embed_dim]

Source
load_weights!(loader : SafetensorsLoader, prefix : String = "encoder")

Load weights from safetensors

Source
norm
Source
parameters
Source
patch_embed
Source
pos_embed
Source