class

GS::MASt3R::WeightLoader

Inherits Reference < Object

Weight loading utilities for MASt3R model

Constants

EXPECTED_UNUSED = ["mask_token"]

Tensors not needed for inference (from MAE pretraining)

Constructors

new(path : String, device : Tensor::Device = Tensor::Device::CPU)
Source

Instance methods

device
Source
load_decoder!(decoder : MASt3RDecoder)

Load decoder weights Decoder structure: decoder_embed.weight [768, 1024] decoder_embed.bias [768] dec_blocks.{0-11}.attn.qkv.weight [2304, 768] dec_blocks.{0-11}.cross_attn.projq/projk/projv.weight [768, 768] dec_blocks.{0-11}.cross_attn.proj.weight [768, 768] dec_blocks.{0-11}.mlp.fc1/fc2.weight dec_blocks.{0-11}.norm1/norm2/norm3/norm_y.weight dec_blocks2.{0-11}... (second decoder for pair processing) dec_norm.weight/bias [768]

Source
load_dpt_head!(head : DPTHead, prefix : String)

Load DPT head weights

Source
load_encoder!(encoder : MASt3REncoderV2)

Load encoder weights Encoder structure: patch_embed.proj.weight [1024, 3, 16, 16] patch_embed.proj.bias [1024] enc_blocks.{0-23}.attn.qkv.weight [3072, 1024] enc_blocks.{0-23}.attn.qkv.bias [3072] enc_blocks.{0-23}.attn.proj.weight [1024, 1024] enc_blocks.{0-23}.attn.proj.bias [1024] enc_blocks.{0-23}.mlp.fc1.weight [4096, 1024] enc_blocks.{0-23}.mlp.fc1.bias [4096] enc_blocks.{0-23}.mlp.fc2.weight [1024, 4096] enc_blocks.{0-23}.mlp.fc2.bias [1024] enc_blocks.{0-23}.norm1.weight/bias [1024] enc_blocks.{0-23}.norm2.weight/bias [1024] enc_norm.weight/bias [1024]

Source
loader
Source
summary

Summary

Source