MCPcopy Create free account

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

Functions270 in github.com/MiniMax-AI/VTP

↓ 13 callersFunctionis_main_process
()
tools/test_linear_probing_hf.py:71
↓ 6 callersMethodreset_parameters
(self)
vtp/models/layers/misc.py:22
↓ 6 callersFunctiontext_global_pool
( x: torch.Tensor, text: Optional[torch.Tensor] = None, pool_type: str = 'argmax', )
vtp/models/encoders/text_transformer.py:213
↓ 5 callersFunction_ntuple
(n)
vtp/models/utils/text_utils.py:70
↓ 5 callersFunctioncat_keep_shapes
(x_list: List[Tensor])
vtp/models/utils/utils.py:14
↓ 5 callersFunctionuncat_with_shapes
(flattened: Tensor, shapes: List[Tuple[int]], num_tokens: List[int])
vtp/models/utils/utils.py:21
↓ 4 callersMethod__init__
( self, dim: int, num_heads: int = 8, qkv_bias: bool = True,
vtp/models/layers/attention.py:180
↓ 4 callersFunctionfeature_take_indices
Determine the absolute feature indices to 'take' from. Note: This function can be called in forward() so must be torchscript compatible, whi
vtp/models/utils/text_utils.py:113
↓ 4 callersFunctionget_branges_scales
Global sampling allocation aligned with dinov2: - Under DDP, compute global keep samples and distribute evenly across ranks - Return loca
vtp/models/layers/block.py:20
↓ 3 callersMethod__init__
(self, use_dropout=True)
vtp/utils/lpips.py:64
↓ 3 callersMethod__init__
( self, width: int, layers: int, heads: int, mlp_r
vtp/models/encoders/text_transformer.py:24
↓ 3 callersMethod__init__
( self, dim: int, num_heads: int, ffn_ratio: float = 4.0, qkv_bias: bo
vtp/models/layers/block.py:140
↓ 3 callersFunction_run
(command)
vtp/models/utils/utils.py:89
↓ 3 callersFunctioncalculate_fid_given_paths
Calculate FID between two image folders.
tools/test_reconstruction_hf.py:98
↓ 3 callersMethodget_cast_dtype
(self)
vtp/models/encoders/text_transformer.py:54
↓ 3 callersMethodget_clip_image_feature
Get CLIP-projected image features for zero-shot tasks. Args: image: Input images, shape (B, C, H, W). normalize: Whet
vtp/models/vtp_hf/modeling_vtp.py:244
↓ 3 callersMethodget_clip_text_feature
Get CLIP-projected text features for zero-shot tasks. Args: text: Input token IDs, shape (B, L). normalize: Whether t
vtp/models/vtp_hf/modeling_vtp.py:278
↓ 3 callersMethodget_latents_decoded_images
Decode latents to reconstructed images. Args: latents: Latent features, shape (B, C, H', W'). Returns: Recon
vtp/models/vtp_hf/modeling_vtp.py:362
↓ 3 callersMethodget_reconstruction_latents
Get bottleneck latents for reconstruction. Args: image: Input images, shape (B, C, H, W). Returns: Latents i
vtp/models/vtp_hf/modeling_vtp.py:337
↓ 3 callersFunctionreduce_mean
(values)
tools/test_reconstruction_hf.py:417
↓ 2 callersMethod__init__
(self, classifiers_dict: Dict[str, nn.Module])
tools/test_linear_probing_hf.py:176
↓ 2 callersMethod_embeds
(self, text)
vtp/models/encoders/text_transformer.py:349
↓ 2 callersMethod_forward_list
(self, x_list: List[Tensor], rope_list=None, drop_ratio: Optional[float] = None)
vtp/models/layers/block.py:235
↓ 2 callersMethod_maybe_index_rope
(rope: Optional[Tuple[Tensor, Tensor]], indices: Tensor)
vtp/models/layers/block.py:190
↓ 2 callersMethod_process_output_dict
(self, output_dict)
vtp/models/encoders/vision_transformer_bottleneck.py:66
↓ 2 callersMethodattention
( self, q_x: torch.Tensor, k_x: Optional[torch.Tensor] = None,
vtp/models/layers/block.py:401
↓ 2 callersFunctionbasic_clean
Basic text cleaning.
vtp/tokenizers/text_tokenizer.py:110
↓ 2 callersFunctionbytes_to_unicode
Returns list of utf-8 byte and a corresponding list of unicode strings. The reversible bpe codes work on unicode strings. This means you
vtp/tokenizers/text_tokenizer.py:76
↓ 2 callersFunctioncenter_crop_arr
Center cropping implementation from ADM. https://github.com/openai/guided-diffusion/blob/8fb3ad9197f16bbc40620447b2742e13458d2831/guided_diff
vtp/utils/image_utils.py:5
↓ 2 callersMethodcompute_attention
(self, qkv: Tensor, attn_bias=None, rope=None)
vtp/models/layers/attention.py:110
↓ 2 callersFunctioncount_images_in_directory
Count the number of image files in a directory.
tools/test_reconstruction_hf.py:179
↓ 2 callersFunctioncreate_linear_input
Create input for linear classifier from intermediate features.
tools/test_linear_probing_hf.py:137
↓ 2 callersMethoddecode
Decode token IDs to text.
vtp/tokenizers/text_tokenizer.py:259
↓ 2 callersMethodencode_image
(self, image: torch.Tensor, normalize: bool = False)
vtp/models/vtp.py:275
↓ 2 callersMethodencode_text
(self, text: torch.Tensor, normalize: bool = False)
vtp/models/vtp.py:295
↓ 2 callersMethodforward_features_list
(self, x_list: List[Tensor], masks_list: List[Tensor], drop_ratio: Optional[float] = None)
vtp/models/encoders/vision_transformer.py:221
↓ 2 callersMethodforward_list
(self, x_list: List[Tensor])
vtp/models/layers/ffn.py:15
↓ 2 callersFunctionget_1d_sincos_pos_embed_from_grid
Generate 1D sincos position embedding from grid. Args: embed_dim: output dimension for each position pos: a list of position
vtp/models/layers/embeddings.py:231
↓ 2 callersFunctionget_activations
(path, model, batch_size, dims, device, num_workers)
tools/test_reconstruction_hf.py:139
↓ 2 callersFunctionget_autocast_context
Get autocast context manager based on precision.
tools/test_zero_shot_hf.py:328
↓ 2 callersFunctionget_pairs
Return set of symbol pairs in a word. Word is represented as tuple of symbols (symbols being variable-length strings).
vtp/tokenizers/text_tokenizer.py:98
↓ 2 callersFunctionget_rank
()
tools/test_linear_probing_hf.py:79
↓ 2 callersFunctionget_world_size
()
tools/test_linear_probing_hf.py:75
↓ 2 callersFunctionmake_2tuple
Convert input to 2-tuple.
vtp/models/layers/embeddings.py:9
↓ 2 callersFunctionmd5_hash
(path)
vtp/utils/lpips.py:42
↓ 2 callersFunctionnamed_apply
( fn: Callable, module: nn.Module, name: str = "", depth_first: bool = True, include_root:
vtp/models/utils/utils.py:53
↓ 2 callersFunctionnormalize_tensor
(x, eps=1e-10)
vtp/utils/lpips.py:169
↓ 2 callersMethodprepare_tokens_with_masks
(self, x: Tensor, masks=None)
vtp/models/encoders/vision_transformer.py:189
↓ 2 callersFunctionrope_apply
(x: Tensor, sin: Tensor, cos: Tensor)
vtp/models/layers/attention.py:19
↓ 2 callersFunctionwhitespace_clean
Clean whitespace.
vtp/tokenizers/text_tokenizer.py:117
↓ 1 callersMethod__init__
(self, device='cuda')
tools/test_reconstruction_hf.py:68
↓ 1 callersMethod__init__
( self, dim: int, init_values: Union[float, Tensor] = 1e-5, inplace: bool = Fa
vtp/models/layers/misc.py:10
↓ 1 callersMethod__init__
( self, in_features: int, hidden_features: Optional[int] = None, out_features:
vtp/models/layers/ffn.py:24
↓ 1 callersMethod__init__
( self, img_size: Union[int, Tuple[int, int]] = 224, patch_size: Union[int, Tuple[int,
vtp/models/layers/embeddings.py:30
↓ 1 callersMethod_apply_feature_bottleneck
(self, features)
vtp/models/encoders/vision_transformer_bottleneck.py:43
↓ 1 callersFunction_build_mlp
Build MLP for DINO head. Args: nlayers: Number of layers in_dim: Input dimension bottleneck_dim: Output dimension
vtp/models/heads/dino_head.py:92
↓ 1 callersFunction_build_text_tower_from_config
(vtp_config)
vtp/models/vtp.py:54
↓ 1 callersFunction_calculate_fid_manual
Manual FID calculation using InceptionV3.
tools/test_reconstruction_hf.py:121
↓ 1 callersMethod_convert_patch_tokens_to_4d
Convert 3D patch tokens (B, N, C) to 4D format (B, C, H, W) for pixel decoder. Args: patch_tokens: Patch tokens from DIN
vtp/models/vtp.py:514
↓ 1 callersFunction_expand_token
(token, batch_size: int)
vtp/models/encoders/text_transformer.py:17
↓ 1 callersFunction_find_bpe_file
Find BPE file in common locations.
vtp/tokenizers/text_tokenizer.py:37
↓ 1 callersMethod_forward_clip
Forward for CLIP mode.
vtp/models/vtp_hf/modeling_vtp.py:427
↓ 1 callersMethod_forward_feature
Forward for feature extraction mode.
vtp/models/vtp_hf/modeling_vtp.py:464
↓ 1 callersMethod_forward_reconstruction
Forward for reconstruction mode.
vtp/models/vtp_hf/modeling_vtp.py:447
↓ 1 callersMethod_get_intermediate_layers_not_chunked
(self, x: Tensor, n: int = 1)
vtp/models/encoders/vision_transformer.py:266
↓ 1 callersMethod_init_text_components
(self)
vtp/models/vtp.py:165
↓ 1 callersMethod_init_text_components
Initialize text encoder and related components.
vtp/models/vtp_hf/modeling_vtp.py:135
↓ 1 callersMethod_init_vision_components
(self)
vtp/models/vtp.py:194
↓ 1 callersMethod_init_vision_components
Initialize vision encoder and related components.
vtp/models/vtp_hf/modeling_vtp.py:92
↓ 1 callersMethod_init_weights
(self)
vtp/models/layers/embeddings.py:182
↓ 1 callersMethod_init_weights
(self, m)
vtp/models/heads/dino_head.py:59
↓ 1 callersMethod_load_vtp_config
( self, vtp_config: Optional[DictConfig], config_path: Optional[str], cli_over
vtp/models/vtp.py:119
↓ 1 callersMethod_norm
(self, x: Tensor)
vtp/models/layers/normalization.py:17
↓ 1 callersMethod_object_to_config_dict
(self, obj)
vtp/models/vtp.py:154
↓ 1 callersMethod_patch_tokens_to_4d
Convert patch tokens (B, N, C) to 4D format (B, C, H, W).
vtp/models/vtp_hf/modeling_vtp.py:379
↓ 1 callersFunction_process_batch
(batch_classnames: List[str])
tools/test_zero_shot_hf.py:374
↓ 1 callersMethod_setup_normalization
Setup normalization and inverse normalization transforms.
generation/tokenizer/vtp_tokenizer.py:56
↓ 1 callersFunctionaccuracy
Calculate top-k accuracy.
tools/test_zero_shot_hf.py:312
↓ 1 callersMethodapply_rope
(self, q: Tensor, k: Tensor, rope: Union[Tensor, Tuple[Tensor, Tensor]])
vtp/models/layers/attention.py:70
↓ 1 callersFunctionbatched
Batch data into lists of length n. The last batch may be shorter.
tools/test_zero_shot_hf.py:302
↓ 1 callersMethodbpe
Apply BPE encoding to a token.
vtp/tokenizers/text_tokenizer.py:208
↓ 1 callersMethodbuild_attention_mask
(self)
vtp/models/encoders/text_transformer.py:519
↓ 1 callersMethodbuild_causal_mask
(self)
vtp/models/encoders/text_transformer.py:334
↓ 1 callersMethodbuild_cls_mask
(self, text, cast_dtype: torch.dtype)
vtp/models/encoders/text_transformer.py:340
↓ 1 callersFunctionbuild_zero_shot_classifier
Build zero-shot classifier weights. Args: model: VTPModel instance with get_clip_text_feature method. tokenizer: Text tokenizer.
tools/test_zero_shot_hf.py:342
↓ 1 callersFunctioncalculate_psnr
Calculate PSNR metric. Args: original: Original image tensor (values in 0-255 range) processed: Reconstructed image tensor (value
tools/test_reconstruction_hf.py:49
↓ 1 callersFunctioncreate_imagenet_dataloader
Create ImageNet validation dataloader.
tools/test_zero_shot_hf.py:448
↓ 1 callersFunctiondefault_bpe
Get default BPE file path.
vtp/tokenizers/text_tokenizer.py:59
↓ 1 callersFunctiondownload
(url, local_path, chunk_size=1024)
vtp/utils/lpips.py:30
↓ 1 callersMethodencode
Encode text to token IDs.
vtp/tokenizers/text_tokenizer.py:250
↓ 1 callersMethodencode_images
(self, images)
generation/tokenizer/vtp_tokenizer.py:83
↓ 1 callersFunctionevaluate
Run zero-shot evaluation. Args: model: VTPModel instance. classifier: Zero-shot classifier weights, shape (embed_dim, num_classes
tools/test_zero_shot_hf.py:401
↓ 1 callersFunctionevaluate
Evaluate all classifiers and return accuracies.
tools/test_linear_probing_hf.py:303
↓ 1 callersMethodforward
(self, x: Tensor)
vtp/models/layers/ffn.py:12
↓ 1 callersMethodforward_clip
( self, image: Optional[torch.Tensor], text: Optional[torch.Tensor] )
vtp/models/vtp.py:340
↓ 1 callersMethodforward_features
(self, x: Union[torch.Tensor, List[torch.Tensor]], masks: Optional[torch.Tensor] = None, **kwargs)
vtp/models/encoders/vision_transformer_bottleneck.py:48
↓ 1 callersMethodforward_features
(self, x: Union[Tensor, List[Tensor]], masks: Optional[Tensor] = None, drop_ratio: Optional[float] = None)
vtp/models/encoders/vision_transformer.py:260
↓ 1 callersMethodforward_intermediates
( self, x: torch.Tensor, attn_mask: Optional[torch.Tensor] = None,
vtp/models/encoders/text_transformer.py:59
↓ 1 callersMethodforward_reconstruction
(self, reconstruction_image: torch.Tensor)
vtp/models/vtp.py:362
↓ 1 callersMethodforward_ssl_learning
( self, global_crops, n_global_crops, mask_indices_list, n_masked_patc
vtp/models/vtp.py:365
next →1–100 of 270, ranked by callers