MCPcopy Create free account

hub / github.com/MiniMax-AI/VTP / functions

Functions270 in github.com/MiniMax-AI/VTP

↓ 1 callersFunctionget_2d_sincos_pos_embed_from_grid
(embed_dim, grid)
vtp/models/layers/embeddings.py:221
↓ 1 callersFunctionget_cache_dir
Get cache directory for LPIPS weights.
vtp/utils/lpips.py:20
↓ 1 callersFunctionget_ckpt_path
(name, root=None, check=False)
vtp/utils/lpips.py:48
↓ 1 callersFunctionget_clean_fn
Get cleaning function by type.
vtp/tokenizers/text_tokenizer.py:134
↓ 1 callersFunctionget_input_dtype
Get input dtype based on precision string.
tools/test_zero_shot_hf.py:319
↓ 1 callersMethodget_intermediate_layers
( self, x: torch.Tensor, *, n: Union[int, Sequence] = 1, reshape: bool
vtp/models/encoders/vision_transformer.py:281
↓ 1 callersMethodget_intermediate_layers_feature
Get features from intermediate layers. Args: image: Input images, shape (B, C, H, W). n: Number of last layers to ret
vtp/models/vtp_hf/modeling_vtp.py:214
↓ 1 callersMethodget_last_layer_feature
Get features from the last layer of vision encoder. This returns the original high-dimensional features without bottleneck, which is
vtp/models/vtp_hf/modeling_vtp.py:184
↓ 1 callersMethodget_reconstruction_outputs
(self, reconstruction_image)
vtp/models/vtp.py:487
↓ 1 callersMethodget_reference_weight
(self)
vtp/models/layers/block.py:470
↓ 1 callersFunctionget_ssim_metric
Get SSIM metric if torchmetrics is available.
tools/test_reconstruction_hf.py:82
↓ 1 callersMethodget_student_ssl_outputs
(self, global_crops, local_crops, masks, mask_indices_list, n_masked_patches, u
vtp/models/vtp.py:452
↓ 1 callersMethodget_teacher_forward_outputs
(self, global_crops, n_global_crops, mask_indices_list, n_masked_patches, up
vtp/models/vtp.py:410
↓ 1 callersFunctionget_tokenizer
Get tokenizer instance. Args: model_name: Model name (for compatibility, not used in simple implementation) context_length:
vtp/tokenizers/text_tokenizer.py:297
↓ 1 callersMethodimg_transform
(self, p_hflip=0, img_size=None)
generation/tokenizer/vtp_tokenizer.py:74
↓ 1 callersMethodinit_parameters
(self)
vtp/models/encoders/text_transformer.py:300
↓ 1 callersMethodinit_weights
(self)
vtp/models/encoders/vision_transformer_bottleneck.py:40
↓ 1 callersMethodinit_weights
(self)
vtp/models/decoders/pixel_decoder.py:123
↓ 1 callersMethodload_from_pretrained
(self, name="vgg_lpips")
vtp/utils/lpips.py:78
↓ 1 callersFunctionmain
()
tools/test_reconstruction_hf.py:470
↓ 1 callersFunctionmain
()
tools/test_zero_shot_hf.py:472
↓ 1 callersFunctionmain
()
tools/test_linear_probing_hf.py:558
↓ 1 callersFunctionmain
(args)
generation/tools/extract_features_vtp.py:22
↓ 1 callersFunctionmain
()
generation/tools/train_lightningdit_vtp.py:24
↓ 1 callersFunctionmain
()
generation/tools/inference_lightningdit_vtp.py:69
↓ 1 callersFunctionmake_eval_transform
(resize_size: int = RESIZE_SIZE, crop_size: int = CROP_SIZE)
tools/test_linear_probing_hf.py:96
↓ 1 callersFunctionmake_train_transform
(crop_size: int = CROP_SIZE)
tools/test_linear_probing_hf.py:87
↓ 1 callersMethodprune_intermediate_layers
Prune layers not required for specified intermediates.
vtp/models/encoders/text_transformer.py:90
↓ 1 callersFunctionrope_rotate_half
(x: Tensor)
vtp/models/layers/attention.py:12
↓ 1 callersFunctionscale_lr
Scale learning rate based on batch size.
tools/test_linear_probing_hf.py:216
↓ 1 callersFunctionsetup_linear_classifiers
Setup linear classifiers with different configurations.
tools/test_linear_probing_hf.py:221
↓ 1 callersFunctionsetup_logger
Setup logger that outputs to both console and file (rank 0 only).
generation/tools/inference_lightningdit_vtp.py:44
↓ 1 callersFunctionspatial_average
(x, keepdim=True)
vtp/utils/lpips.py:174
↓ 1 callersFunctiontest_linear_probing
Run linear probing evaluation. Args: model_path: Path to VTP HuggingFace model directory imagenet_root: Path to ImageNet dataset
tools/test_linear_probing_hf.py:352
↓ 1 callersFunctiontest_reconstruction
Test ImageNet reconstruction. Args: model_path: Path to VTP HuggingFace model directory data_path: Path to ImageNet validation da
tools/test_reconstruction_hf.py:191
↓ 1 callersFunctiontrain_one_epoch
Train for one epoch.
tools/test_linear_probing_hf.py:257
Method__call__
Calculate LPIPS between two images. Args: img1, img2: Images in range [-1, 1] with shape (B, C, H, W)
tools/test_reconstruction_hf.py:72
Method__call__
Returns the tokenized representation of given input string(s). Parameters ---------- texts : Union[str, List[str]]
vtp/tokenizers/text_tokenizer.py:265
Method__getitem__
Get scheduled value for given iteration. Args: it (int): Current iteration Returns: float: Schedule
vtp/models/utils/text_utils.py:194
Method__init__
(self)
tools/test_reconstruction_hf.py:128
Method__init__
(self, model: VTPModel, n_last_blocks: int, autocast_dtype: torch.dtype)
tools/test_linear_probing_hf.py:112
Method__init__
(self, out_dim: int, use_n_blocks: int, use_avgpool: bool, num_classes: int = 1000)
tools/test_linear_probing_hf.py:158
Method__init__
(self, sampler: Sampler, shuffle: bool = True, seed: int = 0)
tools/test_linear_probing_hf.py:195
Method__init__
Initialize VTP Tokenizer. Args: hf_model_path: Path to HuggingFace VTPModel directory img_size: Input image size
generation/tokenizer/vtp_tokenizer.py:15
Method__init__
( self, bpe_path: Optional[str] = None, additional_special_tokens: Optiona
vtp/tokenizers/text_tokenizer.py:147
Method__init__
(self)
vtp/utils/lpips.py:104
Method__init__
(self, chn_in, chn_out=1, use_dropout=False)
vtp/utils/lpips.py:120
Method__init__
(self, requires_grad=False, pretrained=True)
vtp/utils/lpips.py:128
Method__init__
Args: vtp_config: Pre-constructed configuration (takes priority). config_path: Path to load YAML from when vtp_config
vtp/models/vtp.py:97
Method__init__
Initialize cosine scheduler. Args: base_value (float): Initial value after warmup final_value (float): Final
vtp/models/utils/text_utils.py:168
Method__init__
(self, *args, vit_feature_bottleneck: Optional[int] = None, **kwargs)
vtp/models/encoders/vision_transformer_bottleneck.py:19
Method__init__
( self, width: int, layers: int, heads: int, mlp_r
vtp/models/encoders/text_transformer.py:114
Method__init__
( self, context_length: int = 77, vocab_size: int = 49408, wid
vtp/models/encoders/text_transformer.py:236
Method__init__
( self, width: int, layers: int, heads: int, conte
vtp/models/encoders/text_transformer.py:458
Method__init__
( self, *, img_size: int = 224, patch_size: int = 16, in_chans: int =
vtp/models/encoders/vision_transformer.py:61
Method__init__
( self, prob: float = 0.5, exclude_first_token: bool = True )
vtp/models/layers/misc.py:35
Method__init__
( self, dim: int, num_heads: int, ffn_ratio: float = 4.0, ls_init_valu
vtp/models/layers/block.py:314
Method__init__
( self, d_model: int, n_head: int, mlp_ratio: float = 4.0,
vtp/models/layers/block.py:373
Method__init__
( self, d_model: int, n_head: int, mlp_ratio: float = 4.0,
vtp/models/layers/block.py:433
Method__init__
( self, in_features: int, hidden_features: Optional[int] = None, out_features:
vtp/models/layers/ffn.py:57
Method__init__
(self, *args, **kwargs)
vtp/models/layers/attention.py:29
Method__init__
( self, dim: int, num_heads: int = 8, qkv_bias: bool = False, proj_bia
vtp/models/layers/attention.py:44
Method__init__
( self, dim: int, num_heads: int = 8, qkv_bias: bool = False, proj_bia
vtp/models/layers/attention.py:132
Method__init__
( self, d_model: int, context_dim: int, n_head: int = 8,
vtp/models/layers/attention.py:279
Method__init__
( self, embed_dim: int, *, num_heads: int, base: Optional[float] = 100
vtp/models/layers/embeddings.py:92
Method__init__
(self, dim: int, eps: float = 1e-5)
vtp/models/layers/normalization.py:9
Method__init__
( self, *, in_chans: int = 256, out_chans: int = 3, upscale_factor: in
vtp/models/decoders/pixel_decoder.py:22
Method__init__
( self, in_dim: int, out_dim: int, use_bn: bool = False, nlayers: int
vtp/models/heads/dino_head.py:24
Method__init__
( self, # General image_size: int = 256, train_clip: bool = True, trai
vtp/models/vtp_hf/configuration_vtp.py:67
Method__init__
(self, config: VTPConfig)
vtp/models/vtp_hf/modeling_vtp.py:82
Method__iter__
(self)
tools/test_linear_probing_hf.py:201
Method__len__
(self)
tools/test_linear_probing_hf.py:184
Method__len__
(self)
tools/test_linear_probing_hf.py:208
Function_clean_lower
Basic, remove whitespace, lower case.
vtp/tokenizers/text_tokenizer.py:124
Function_clean_whitespace
Basic, remove whitespace.
vtp/tokenizers/text_tokenizer.py:129
Method_create_block
(bt: str)
vtp/models/encoders/text_transformer.py:136
Method_forward
(self, x: Tensor, rope=None, drop_ratio: Optional[float] = None)
vtp/models/layers/block.py:201
Method_init_weights
Initialize weights following VTP conventions.
vtp/models/vtp_hf/modeling_vtp.py:38
Function_out_indices_as_tuple
(x: Union[int, Tuple[int, ...]])
vtp/models/utils/text_utils.py:154
Functionas_torch_dtype
(dtype: TypeSpec)
vtp/models/utils/dtype.py:24
Functionclear_sampling_cache
()
vtp/models/layers/block.py:121
Functionconvert_int8_model_to_inference_mode
(model)
vtp/models/utils/text_utils.py:105
Functionconvert_patch_tokens_to_4d
Convert 3D patch tokens (B, N, C) to 4D format (B, C, H, W). Args: patch_tokens: Patch tokens with shape (B, N, C) patch_siz
vtp/utils/tensor_utils.py:4
Methoddecode_to_images
(self, z)
generation/tokenizer/vtp_tokenizer.py:95
Functiondinov3_pixel_decoder_base
Base DINOv3-based pixel decoder
vtp/models/decoders/pixel_decoder.py:183
Functiondinov3_pixel_decoder_large
Large DINOv3-based pixel decoder
vtp/models/decoders/pixel_decoder.py:200
Functiondinov3_pixel_decoder_small
Small DINOv3-based pixel decoder
vtp/models/decoders/pixel_decoder.py:166
Methodencode
Encode images to latent features.
vtp/models/encoders/vision_transformer_bottleneck.py:99
Functionfix_random_seeds
Fix random seeds.
vtp/models/utils/utils.py:76
Methodflops
(self)
vtp/models/layers/embeddings.py:72
Methodforward
(self, x)
tools/test_reconstruction_hf.py:135
Methodforward
Extract intermediate layer features. Returns: List of (patch_tokens, cls_token) tuples for each requested layer
tools/test_linear_probing_hf.py:119
Methodforward
(self, x_tokens_list)
tools/test_linear_probing_hf.py:168
Methodforward
(self, inputs)
tools/test_linear_probing_hf.py:181
Methodforward
(self, input, target)
vtp/utils/lpips.py:84
Methodforward
(self, inp)
vtp/utils/lpips.py:113
Methodforward
(self, X)
vtp/utils/lpips.py:151
Methodforward
( self, image: Optional[torch.Tensor] = None, text: Optional[torch.Tensor] = None,
vtp/models/vtp.py:323
Methodforward
(self, x: torch.Tensor, attn_mask: Optional[torch.Tensor] = None)
vtp/models/encoders/text_transformer.py:96
Methodforward
(self, x: torch.Tensor, attn_mask: Optional[torch.Tensor] = None)
vtp/models/encoders/text_transformer.py:198
← previousnext →101–200 of 270, ranked by callers