SYMBOL INDEX (509 symbols across 30 files) FILE: src/configs/config.py function parse_with_config (line 12) | def parse_with_config(parsed_args): class SharedConfigs (line 32) | class SharedConfigs(object): method __init__ (line 42) | def __init__(self, desc="shared config for pretraining and finetuning"): method parse_args (line 213) | def parse_args(self): method get_sparse_pretraining_args (line 244) | def get_sparse_pretraining_args(self): method get_video_retrieval_args (line 279) | def get_video_retrieval_args(self): method get_nlvl_args (line 287) | def get_nlvl_args(self): method get_vqa_args (line 293) | def get_vqa_args(self): method get_video_qa_args (line 308) | def get_video_qa_args(self): FILE: src/datasets/data_utils.py function mask_batch_text_tokens (line 23) | def mask_batch_text_tokens( function select_batch_text_pivots (line 73) | def select_batch_text_pivots( function image_to_tensor (line 182) | def image_to_tensor(image: np.ndarray, keepdim: bool = True) -> torch.Te... function get_padding (line 221) | def get_padding(image, max_w, max_h, pad_all=False): class ImagePad (line 245) | class ImagePad(object): method __init__ (line 246) | def __init__(self, max_w, max_h, fill=0, padding_mode='constant'): method __call__ (line 254) | def __call__(self, img): method __repr__ (line 271) | def __repr__(self): function get_resize_size (line 276) | def get_resize_size(image, max_size): class VideoRandomSquareCrop (line 310) | class VideoRandomSquareCrop(object): method __init__ (line 311) | def __init__(self, crop_size, p=0.5): method __call__ (line 316) | def __call__(self, video): class VideoResizeSquare (line 342) | class VideoResizeSquare(object): method __init__ (line 343) | def __init__(self, out_size, interpolation='nearest'): method __call__ (line 348) | def __call__(self, video): method __repr__ (line 378) | def __repr__(self): class ImageResize (line 383) | class ImageResize(object): method __init__ (line 396) | def __init__(self, max_size, interpolation=Image.BILINEAR): method __call__ (line 401) | def __call__(self, img): method __repr__ (line 417) | def __repr__(self): function get_imagenet_transform (line 423) | def get_imagenet_transform(min_size=600, max_size=1000): class ImageNorm (line 437) | class ImageNorm(object): method __init__ (line 440) | def __init__(self, mean, std): method __call__ (line 447) | def __call__(self, img): function chunk_list (line 460) | def chunk_list(examples, chunk_size=2, pad_to_divisible=True): function mk_input_group (line 488) | def mk_input_group(key_grouped_examples, max_n_example_per_group=1, is_t... FILE: src/datasets/dataloader.py class MetaLoader (line 14) | class MetaLoader(object): method __init__ (line 16) | def __init__(self, loaders, accum_steps=1, distributed=False): method __iter__ (line 38) | def __iter__(self): function move_to_cuda (line 59) | def move_to_cuda(batch): function record_cuda_stream (line 73) | def record_cuda_stream(batch): class PrefetchLoader (line 86) | class PrefetchLoader(object): method __init__ (line 91) | def __init__(self, loader, img_normalize=None): method __iter__ (line 96) | def __iter__(self): method __len__ (line 122) | def __len__(self): method preload (line 125) | def preload(self, it): method next (line 150) | def next(self, it): method __getattr__ (line 158) | def __getattr__(self, name): class InfiniteIterator (line 163) | class InfiniteIterator(object): method __init__ (line 165) | def __init__(self, iterable): method __iter__ (line 169) | def __iter__(self): FILE: src/datasets/dataset_base.py class AlproBaseDataset (line 18) | class AlproBaseDataset(Dataset): method __init__ (line 35) | def __init__(self, datalist, tokenizer, img_lmdb_dir, img_db_type='lmd... method __len__ (line 62) | def __len__(self): method __getitem__ (line 65) | def __getitem__(self, index): method _load_img (line 68) | def _load_img(self, img_id): method _is_extreme_aspect_ratio (line 86) | def _is_extreme_aspect_ratio(cls, tensor, max_ratio=5.): method _load_video (line 95) | def _load_video(self, video_id, num_clips=None, clip_idx=None, method _load_video_from_path_decord (line 137) | def _load_video_from_path_decord(self, video_path, height=None, width=... function img_collate (line 184) | def img_collate(imgs): FILE: src/datasets/dataset_pretrain_sparse.py class AlproPretrainSparseDataset (line 22) | class AlproPretrainSparseDataset(AlproBaseDataset): method __init__ (line 36) | def __init__(self, datalist, tokenizer, img_lmdb_dir, img_db_type, txt... method __len__ (line 65) | def __len__(self): method __getitem__ (line 68) | def __getitem__(self, index): class PretrainImageTextDataset (line 125) | class PretrainImageTextDataset(Dataset): method __init__ (line 126) | def __init__(self, datalist, tokenizer, is_train=True, crop_size=256, ... method __len__ (line 143) | def __len__(self): method __getitem__ (line 146) | def __getitem__(self, index): class PretrainCollator (line 196) | class PretrainCollator(object): method __init__ (line 200) | def __init__(self, tokenizer, method collate_batch (line 214) | def collate_batch(self, batch): function random_erase (line 277) | def random_erase(input_img, patch_size, s_l=0.3, s_h=0.5, r_1=0.3, r_2=1... FILE: src/datasets/dataset_video_qa.py class AlproVideoQADataset (line 13) | class AlproVideoQADataset(AlproBaseDataset): method __init__ (line 28) | def __init__(self, task_type, datalist, tokenizer, img_lmdb_dir, method __len__ (line 55) | def __len__(self): method __getitem__ (line 59) | def __getitem__(self, index): method _get_single_example (line 89) | def _get_single_example(self, data): method evaluate_qa (line 102) | def evaluate_qa(self, results): class VideoQACollator (line 158) | class VideoQACollator(object): method __init__ (line 159) | def __init__(self, tokenizer, max_length=20, task_type="action", n_opt... method collate_batch (line 165) | def collate_batch(self, batch): FILE: src/datasets/dataset_video_retrieval.py class AlproVideoRetrievalDataset (line 13) | class AlproVideoRetrievalDataset(AlproBaseDataset): method __init__ (line 22) | def __init__(self, datalist, tokenizer, img_lmdb_dir, method __len__ (line 47) | def __len__(self): method __getitem__ (line 50) | def __getitem__(self, index): method _get_single_example (line 83) | def _get_single_example(self, data, index): class VideoRetrievalCollator (line 95) | class VideoRetrievalCollator(object): method __init__ (line 96) | def __init__(self, tokenizer, max_length=40): method collate_batch (line 100) | def collate_batch(self, batch): class AlproVideoRetrievalEvalDataset (line 143) | class AlproVideoRetrievalEvalDataset(AlproBaseDataset): method __init__ (line 153) | def __init__(self, datalist, tokenizer, img_lmdb_dir, method __len__ (line 174) | def __len__(self): method __getitem__ (line 177) | def __getitem__(self, index): method _prepare_batches_by_video (line 198) | def _prepare_batches_by_video(self): FILE: src/datasets/randaugment.py function identity_func (line 7) | def identity_func(img): function autocontrast_func (line 11) | def autocontrast_func(img, cutoff=0): function equalize_func (line 44) | def equalize_func(img): function rotate_func (line 67) | def rotate_func(img, degree, fill=(0, 0, 0)): function horizontal_flip_func (line 78) | def horizontal_flip_func(img): function solarize_func (line 88) | def solarize_func(img, thresh=128): function color_func (line 98) | def color_func(img, factor): function contrast_func (line 120) | def contrast_func(img, factor): function brightness_func (line 133) | def brightness_func(img, factor): function sharpness_func (line 142) | def sharpness_func(img, factor): function shear_x_func (line 163) | def shear_x_func(img, factor, fill=(0, 0, 0)): function translate_x_func (line 170) | def translate_x_func(img, offset, fill=(0, 0, 0)): function translate_y_func (line 180) | def translate_y_func(img, offset, fill=(0, 0, 0)): function posterize_func (line 190) | def posterize_func(img, bits): function shear_y_func (line 198) | def shear_y_func(img, factor, fill=(0, 0, 0)): function enhance_level_to_args (line 219) | def enhance_level_to_args(MAX_LEVEL): function shear_level_to_args (line 225) | def shear_level_to_args(MAX_LEVEL, replace_value): function translate_level_to_args (line 234) | def translate_level_to_args(translate_const, MAX_LEVEL, replace_value): function cutout_level_to_args (line 243) | def cutout_level_to_args(cutout_const, MAX_LEVEL, replace_value): function solarize_level_to_args (line 251) | def solarize_level_to_args(MAX_LEVEL): function none_level_to_args (line 258) | def none_level_to_args(level): function posterize_level_to_args (line 262) | def posterize_level_to_args(MAX_LEVEL): function rotate_level_to_args (line 269) | def rotate_level_to_args(MAX_LEVEL, replace_value): class TemporalConsistentRandomAugment (line 323) | class TemporalConsistentRandomAugment(object): method __init__ (line 325) | def __init__(self, N=2, M=10, p=0.0, tensor_in_tensor_out=True, augs=[]): method get_random_ops (line 335) | def get_random_ops(self): method __call__ (line 340) | def __call__(self, frames): method _aug (line 355) | def _aug(self, img, ops, apply_or_not): class RandomAugment (line 363) | class RandomAugment(object): method __init__ (line 365) | def __init__(self, N=2, M=10, isPIL=False, augs=[]): method get_random_ops (line 374) | def get_random_ops(self): method __call__ (line 378) | def __call__(self, img): function save_frames_grid (line 390) | def save_frames_grid(img_array, out_path): function stack (line 415) | def stack(data, dim=0): FILE: src/modeling/alpro_models.py class AlproBaseModel (line 19) | class AlproBaseModel(nn.Module): method __init__ (line 20) | def __init__(self, config=None, input_format='RGB', video_enc_cfg=None... method load_separate_ckpt (line 45) | def load_separate_ckpt(self, visual_weights_path=None, bert_weights_pa... class AlproForPretrain (line 58) | class AlproForPretrain(AlproBaseModel): method __init__ (line 59) | def __init__(self, config, video_enc_cfg, input_format='RGB'): method build_text_prompts (line 73) | def build_text_prompts(self, prompts): method get_pseudo_labels (line 76) | def get_pseudo_labels(self, batch): method forward (line 79) | def forward(self, batch): method _forward_visual_embeds (line 186) | def _forward_visual_embeds(self, visual_inputs): method _forward_text_feats (line 196) | def _forward_text_feats(self, batch): method compute_mpm_with_encoder_out (line 209) | def compute_mpm_with_encoder_out(self, encoder_outputs, text_atts, sof... method compute_mpm (line 234) | def compute_mpm(self, text_embeds, text_atts, image_embeds, image_atts... method compute_vtm (line 269) | def compute_vtm(self, text_embeds, text_atts, video_embeds, video_atts... method compute_mlm (line 346) | def compute_mlm(self, input_ids, text_input_mask, video_embeds, video_... method load_separate_ckpt (line 375) | def load_separate_ckpt(self, visual_weights_path=None, bert_weights_pa... class Prompter (line 389) | class Prompter(AlproBaseModel): method __init__ (line 390) | def __init__(self, config, video_enc_cfg, input_format='RGB'): method load_pretrained_weights_without_prompts (line 404) | def load_pretrained_weights_without_prompts(self, ckpt_path): method build_text_prompts (line 430) | def build_text_prompts(self, prompts): method _forward_visual_embeds (line 509) | def _forward_visual_embeds(self, visual_inputs): method _compute_soft_labels (line 525) | def _compute_soft_labels(self, sim_vp_masked): method get_pseudo_labels (line 531) | def get_pseudo_labels(self, batch): method forward (line 553) | def forward(self, batch): method forward_feats (line 597) | def forward_feats(self, batch): class AlproForSequenceClassification (line 633) | class AlproForSequenceClassification(AlproBaseModel): method __init__ (line 634) | def __init__(self, config, video_enc_cfg, input_format='RGB'): method forward (line 647) | def forward(self, batch): method forward_inference (line 691) | def forward_inference(self, batch): class AlproForVideoTextRetrieval (line 727) | class AlproForVideoTextRetrieval(AlproBaseModel): method __init__ (line 730) | def __init__(self, config, video_enc_cfg, input_format='RGB'): method forward (line 733) | def forward(self, batch): method compute_vtm (line 800) | def compute_vtm(self, text_embeds, text_atts, image_embeds, image_atts... method forward_inference (line 874) | def forward_inference(self, batch): FILE: src/modeling/timesformer/conv2d_same.py function pad_same (line 14) | def pad_same(x, k: List[int], s: List[int], d: List[int] = (1, 1), value... function get_same_padding (line 22) | def get_same_padding(x: int, k: int, s: int, d: int): function get_padding_value (line 25) | def get_padding_value(padding, kernel_size, **kwargs) -> Tuple[Tuple, bo... function conv2d_same (line 47) | def conv2d_same( class Conv2dSame (line 54) | class Conv2dSame(nn.Conv2d): method __init__ (line 58) | def __init__(self, in_channels, out_channels, kernel_size, stride=1, method forward (line 63) | def forward(self, x): function create_conv2d_pad (line 67) | def create_conv2d_pad(in_chs, out_chs, kernel_size, **kwargs): FILE: src/modeling/timesformer/features.py class FeatureInfo (line 12) | class FeatureInfo: method __init__ (line 14) | def __init__(self, feature_info: List[Dict], out_indices: Tuple[int]): method from_other (line 25) | def from_other(self, out_indices: Tuple[int]): method get (line 28) | def get(self, key, idx=None): method get_dicts (line 41) | def get_dicts(self, keys=None, idx=None): method channels (line 54) | def channels(self, idx=None): method reduction (line 59) | def reduction(self, idx=None): method module_name (line 64) | def module_name(self, idx=None): method __getitem__ (line 69) | def __getitem__(self, item): method __len__ (line 72) | def __len__(self): class FeatureHooks (line 76) | class FeatureHooks: method __init__ (line 83) | def __init__(self, hooks, named_modules, out_map=None, default_hook_ty... method _collect_output_hook (line 100) | def _collect_output_hook(self, hook_id, *args): method get_output (line 106) | def get_output(self, device) -> Dict[str, torch.tensor]: function _module_list (line 112) | def _module_list(module, flatten_sequential=False): function _get_feature_info (line 126) | def _get_feature_info(net, out_indices): function _get_return_layers (line 136) | def _get_return_layers(feature_info, out_map): class FeatureDictNet (line 144) | class FeatureDictNet(nn.ModuleDict): method __init__ (line 164) | def __init__( method _collect (line 187) | def _collect(self, x) -> (Dict[str, torch.Tensor]): method forward (line 201) | def forward(self, x) -> Dict[str, torch.Tensor]: class FeatureListNet (line 205) | class FeatureListNet(FeatureDictNet): method __init__ (line 210) | def __init__( method forward (line 217) | def forward(self, x) -> (List[torch.Tensor]): class FeatureHookNet (line 221) | class FeatureHookNet(nn.ModuleDict): method __init__ (line 230) | def __init__( method forward (line 262) | def forward(self, x): FILE: src/modeling/timesformer/helpers.py function load_state_dict (line 26) | def load_state_dict(checkpoint_path, use_ema=False): function load_checkpoint (line 57) | def load_checkpoint(model, checkpoint_path, use_ema=False, strict=True): function load_pretrained (line 102) | def load_pretrained(model, cfg=None, num_classes=1000, in_chans=3, filte... function load_pretrained_CLIP_ViT (line 213) | def load_pretrained_CLIP_ViT(model, pretrained_model, cfg=None, ignore_c... function load_pretrained_imagenet (line 262) | def load_pretrained_imagenet(model, pretrained_model, cfg=None, ignore_c... function load_pretrained_kinetics (line 315) | def load_pretrained_kinetics(model, pretrained_model, cfg=None, ignore_c... function resize_spatial_embedding (line 355) | def resize_spatial_embedding(state_dict, key, num_patches): function resize_temporal_embedding (line 370) | def resize_temporal_embedding(state_dict, key, num_frames): FILE: src/modeling/timesformer/linear.py class Linear (line 7) | class Linear(nn.Linear): method forward (line 8) | def forward(self, input: torch.Tensor) -> torch.Tensor: FILE: src/modeling/timesformer/vit.py function _cfg (line 30) | def _cfg(url='', **kwargs): class Mlp (line 49) | class Mlp(nn.Module): method __init__ (line 50) | def __init__(self, in_features, hidden_features=None, out_features=Non... method forward (line 59) | def forward(self, x): class Attention (line 68) | class Attention(nn.Module): method __init__ (line 69) | def __init__(self, dim, num_heads=8, qkv_bias=False, qk_scale=None, at... method forward (line 81) | def forward(self, x): class Block (line 103) | class Block(nn.Module): method __init__ (line 105) | def __init__(self, dim, num_heads, layer_num, mlp_ratio=4., qkv_bias=F... method forward (line 136) | def forward(self, x, B, T, W): class PatchEmbed (line 216) | class PatchEmbed(nn.Module): method __init__ (line 220) | def __init__(self, img_size=224, patch_size=16, in_chans=3, embed_dim=... method forward (line 233) | def forward(self, x): class VisionTransformer (line 242) | class VisionTransformer(nn.Module): method __init__ (line 246) | def __init__(self, img_size=224, patch_size=16, in_chans=3, num_classe... method _init_weights (line 300) | def _init_weights(self, m): method no_weight_decay (line 310) | def no_weight_decay(self): method get_classifier (line 313) | def get_classifier(self): method reset_classifier (line 316) | def reset_classifier(self, num_classes, global_pool=''): method forward_features (line 321) | def forward_features(self, x, return_all_tokens=False): method forward (line 379) | def forward(self, x): function _conv_filter (line 385) | def _conv_filter(state_dict, patch_size=16): class vit_base_patch16_224 (line 397) | class vit_base_patch16_224(nn.Module): method __init__ (line 398) | def __init__(self, cfg, **kwargs): method forward (line 414) | def forward(self, x): class TimeSformer (line 419) | class TimeSformer(nn.Module): method __init__ (line 420) | def __init__(self, model_cfg, input_format='BGR', cross_attention_conf... method forward (line 471) | def forward(self, x): method forward_features (line 475) | def forward_features(self, x, return_all_tokens=True, pooling='tempora... method _get_pooled_features (line 505) | def _get_pooled_features(self, x): method load_state_dict (line 515) | def load_state_dict(self, pretrained_ckpt_path): FILE: src/modeling/timesformer/vit_utils.py function _no_grad_trunc_normal_ (line 23) | def _no_grad_trunc_normal_(tensor, mean, std, a, b): function trunc_normal_ (line 56) | def trunc_normal_(tensor, mean=0., std=1., a=-2., b=2.): function _ntuple (line 77) | def _ntuple(n): function get_padding (line 86) | def get_padding(kernel_size: int, stride: int = 1, dilation: int = 1, **... function get_padding_value (line 90) | def get_padding_value(padding, kernel_size, **kwargs): function get_same_padding (line 113) | def get_same_padding(x: int, k: int, s: int, d: int): function is_static_pad (line 118) | def is_static_pad(kernel_size: int, stride: int = 1, dilation: int = 1, ... function pad_same (line 124) | def pad_same(x, k, s, d=(1, 1), value= 0): function adaptive_pool_feat_mult (line 131) | def adaptive_pool_feat_mult(pool_type='avg'): function drop_path (line 137) | def drop_path(x, drop_prob: float = 0., training: bool = False): class DropPath (line 154) | class DropPath(nn.Module): method __init__ (line 157) | def __init__(self, drop_prob=None): method forward (line 161) | def forward(self, x): FILE: src/modeling/transformers.py function load_tf_weights_in_bert (line 64) | def load_tf_weights_in_bert(model, config, tf_checkpoint_path): function mish (line 140) | def mish(x): class BertEmbeddings (line 151) | class BertEmbeddings(nn.Module): method __init__ (line 155) | def __init__(self, config): method forward (line 172) | def forward(self, input_ids=None, token_type_ids=None, class BertSelfAttention (line 202) | class BertSelfAttention(nn.Module): method __init__ (line 203) | def __init__(self, config): method transpose_for_scores (line 224) | def transpose_for_scores(self, x): method forward (line 230) | def forward( class BertSelfOutput (line 289) | class BertSelfOutput(nn.Module): method __init__ (line 290) | def __init__(self, config): method forward (line 297) | def forward(self, hidden_states, input_tensor): class BertAttention (line 304) | class BertAttention(nn.Module): method __init__ (line 305) | def __init__(self, config): method prune_heads (line 311) | def prune_heads(self, heads): method forward (line 337) | def forward( class BertIntermediate (line 354) | class BertIntermediate(nn.Module): method __init__ (line 355) | def __init__(self, config): method forward (line 363) | def forward(self, hidden_states): class BertOutput (line 369) | class BertOutput(nn.Module): method __init__ (line 370) | def __init__(self, config): method forward (line 377) | def forward(self, hidden_states, input_tensor): class BertLayer (line 384) | class BertLayer(nn.Module): method __init__ (line 385) | def __init__(self, config): method forward (line 394) | def forward( class BertEncoder (line 421) | class BertEncoder(nn.Module): method __init__ (line 422) | def __init__(self, config): method forward (line 429) | def forward( class BertPooler (line 464) | class BertPooler(nn.Module): method __init__ (line 465) | def __init__(self, config): method forward (line 470) | def forward(self, hidden_states): class BertPredictionHeadTransform (line 479) | class BertPredictionHeadTransform(nn.Module): method __init__ (line 480) | def __init__(self, config): method forward (line 490) | def forward(self, hidden_states): class BertLMPredictionHead (line 497) | class BertLMPredictionHead(nn.Module): method __init__ (line 498) | def __init__(self, config): method forward (line 512) | def forward(self, hidden_states): class BertOnlyMLMHead (line 518) | class BertOnlyMLMHead(nn.Module): method __init__ (line 519) | def __init__(self, config): method forward (line 523) | def forward(self, sequence_output): class BertOnlyNSPHead (line 528) | class BertOnlyNSPHead(nn.Module): method __init__ (line 529) | def __init__(self, config): method forward (line 533) | def forward(self, pooled_output): class BertPreTrainingHeads (line 538) | class BertPreTrainingHeads(nn.Module): method __init__ (line 539) | def __init__(self, config): method forward (line 544) | def forward(self, sequence_output, pooled_output): class BertPreTrainedModel (line 550) | class BertPreTrainedModel(PreTrainedModel): method _init_weights (line 559) | def _init_weights(self, module): FILE: src/modeling/xbert.py function load_tf_weights_in_bert (line 92) | def load_tf_weights_in_bert(model, config, tf_checkpoint_path): class BertEmbeddings (line 166) | class BertEmbeddings(nn.Module): method __init__ (line 169) | def __init__(self, config): method forward (line 186) | def forward( class BertSelfAttention (line 216) | class BertSelfAttention(nn.Module): method __init__ (line 217) | def __init__(self, config, is_cross_attention): method save_attn_gradients (line 245) | def save_attn_gradients(self, attn_gradients): method get_attn_gradients (line 248) | def get_attn_gradients(self): method save_attention_map (line 251) | def save_attention_map(self, attention_map): method get_attention_map (line 254) | def get_attention_map(self): method transpose_for_scores (line 258) | def transpose_for_scores(self, x): method forward (line 263) | def forward( class BertSelfOutput (line 349) | class BertSelfOutput(nn.Module): method __init__ (line 350) | def __init__(self, config): method forward (line 356) | def forward(self, hidden_states, input_tensor): class BertAttention (line 363) | class BertAttention(nn.Module): method __init__ (line 364) | def __init__(self, config, is_cross_attention=False): method prune_heads (line 370) | def prune_heads(self, heads): method forward (line 388) | def forward( class BertIntermediate (line 412) | class BertIntermediate(nn.Module): method __init__ (line 413) | def __init__(self, config): method forward (line 421) | def forward(self, hidden_states): class BertOutput (line 427) | class BertOutput(nn.Module): method __init__ (line 428) | def __init__(self, config): method forward (line 434) | def forward(self, hidden_states, input_tensor): class BertLayer (line 441) | class BertLayer(nn.Module): method __init__ (line 442) | def __init__(self, config, layer_num): method forward (line 457) | def forward( method feed_forward_chunk (line 516) | def feed_forward_chunk(self, attention_output): class BertEncoder (line 522) | class BertEncoder(nn.Module): method __init__ (line 523) | def __init__(self, config): method forward (line 528) | def forward( class BertPooler (line 633) | class BertPooler(nn.Module): method __init__ (line 634) | def __init__(self, config): method forward (line 639) | def forward(self, hidden_states): class BertPredictionHeadTransform (line 648) | class BertPredictionHeadTransform(nn.Module): method __init__ (line 649) | def __init__(self, config): method forward (line 658) | def forward(self, hidden_states): class BertLMPredictionHead (line 665) | class BertLMPredictionHead(nn.Module): method __init__ (line 666) | def __init__(self, config): method forward (line 679) | def forward(self, hidden_states): class BertOnlyMLMHead (line 685) | class BertOnlyMLMHead(nn.Module): method __init__ (line 686) | def __init__(self, config): method forward (line 690) | def forward(self, sequence_output): class BertOnlyNSPHead (line 695) | class BertOnlyNSPHead(nn.Module): method __init__ (line 696) | def __init__(self, config): method forward (line 700) | def forward(self, pooled_output): class BertPreTrainingHeads (line 705) | class BertPreTrainingHeads(nn.Module): method __init__ (line 706) | def __init__(self, config): method forward (line 711) | def forward(self, sequence_output, pooled_output): class BertPreTrainedModel (line 717) | class BertPreTrainedModel(PreTrainedModel): method _init_weights (line 728) | def _init_weights(self, module): class BertForPreTrainingOutput (line 742) | class BertForPreTrainingOutput(ModelOutput): class BertModel (line 832) | class BertModel(BertPreTrainedModel): method __init__ (line 842) | def __init__(self, config, add_pooling_layer=True): method get_input_embeddings (line 855) | def get_input_embeddings(self): method set_input_embeddings (line 858) | def set_input_embeddings(self, value): method _prune_heads (line 861) | def _prune_heads(self, heads_to_prune): method get_extended_attention_mask (line 878) | def get_extended_attention_mask(self, attention_mask: Tensor, input_sh... method forward (line 940) | def forward( class BertForPreTraining (line 1091) | class BertForPreTraining(BertPreTrainedModel): method __init__ (line 1092) | def __init__(self, config): method get_output_embeddings (line 1100) | def get_output_embeddings(self): method set_output_embeddings (line 1103) | def set_output_embeddings(self, new_embeddings): method forward (line 1108) | def forward( class BertLMHeadModel (line 1185) | class BertLMHeadModel(BertPreTrainedModel): method __init__ (line 1190) | def __init__(self, config): method get_output_embeddings (line 1198) | def get_output_embeddings(self): method set_output_embeddings (line 1201) | def set_output_embeddings(self, new_embeddings): method forward (line 1206) | def forward( method prepare_inputs_for_generation (line 1316) | def prepare_inputs_for_generation(self, input_ids, past=None, attentio... method _reorder_cache (line 1335) | def _reorder_cache(self, past, beam_idx): class BertForMaskedLM (line 1343) | class BertForMaskedLM(BertPreTrainedModel): method __init__ (line 1348) | def __init__(self, config): method get_output_embeddings (line 1356) | def get_output_embeddings(self): method set_output_embeddings (line 1359) | def set_output_embeddings(self, new_embeddings): method forward (line 1369) | def forward( method prepare_inputs_for_generation (line 1443) | def prepare_inputs_for_generation(self, input_ids, attention_mask=None... class BertForNextSentencePrediction (line 1462) | class BertForNextSentencePrediction(BertPreTrainedModel): method __init__ (line 1463) | def __init__(self, config): method forward (line 1473) | def forward( class BertForSequenceClassification (line 1556) | class BertForSequenceClassification(BertPreTrainedModel): method __init__ (line 1557) | def __init__(self, config): method forward (line 1574) | def forward( class BertForMultipleChoice (line 1641) | class BertForMultipleChoice(BertPreTrainedModel): method __init__ (line 1642) | def __init__(self, config): method forward (line 1658) | def forward( class BertForTokenClassification (line 1732) | class BertForTokenClassification(BertPreTrainedModel): method __init__ (line 1736) | def __init__(self, config): method forward (line 1753) | def forward( class BertForQuestionAnswering (line 1823) | class BertForQuestionAnswering(BertPreTrainedModel): method __init__ (line 1827) | def __init__(self, config): method forward (line 1843) | def forward( FILE: src/optimization/adamw.py class AdamW (line 11) | class AdamW(Optimizer): method __init__ (line 22) | def __init__(self, params, lr=1e-3, betas=(0.9, 0.999), eps=1e-6, method step (line 40) | def step(self, closure=None): FILE: src/optimization/sched.py function noam_schedule (line 8) | def noam_schedule(step, warmup_step=4000): function warmup_linear (line 14) | def warmup_linear(step, warmup_step, tot_step): function multi_step_schedule (line 20) | def multi_step_schedule(n_epoch, milestones, gamma=0.5): function get_lr_sched (line 28) | def get_lr_sched(global_step, decay, learning_rate, FILE: src/optimization/utils.py function setup_e2e_optimizer (line 5) | def setup_e2e_optimizer(model, opts): FILE: src/pretrain/run_pretrain_contrastive_only.py function mk_captions_pretrain_dataloader (line 37) | def mk_captions_pretrain_dataloader(dataset_name, anno_path, video_dir, ... function setup_dataloaders (line 104) | def setup_dataloaders(cfg, tokenizer): function setup_model (line 125) | def setup_model(cfg, device=None): function forward_step (line 185) | def forward_step(cfg, model, batch): function validate (line 195) | def validate(model, val_loader, cfg): function start_training (line 273) | def start_training(): FILE: src/pretrain/run_pretrain_sparse.py function mk_captions_pretrain_dataloader (line 37) | def mk_captions_pretrain_dataloader(dataset_name, anno_path, video_dir, ... function setup_dataloaders (line 105) | def setup_dataloaders(cfg, tokenizer): function setup_model (line 126) | def setup_model(cfg, device=None): function forward_step (line 184) | def forward_step(cfg, model, batch): function validate (line 194) | def validate(model, val_loader, cfg): function get_video_prompt_templates (line 326) | def get_video_prompt_templates(): function get_image_prompt_templates (line 344) | def get_image_prompt_templates(): function setup_text_prompts (line 365) | def setup_text_prompts(cfg, tokenizer): function start_training (line 404) | def start_training(): FILE: src/tasks/run_video_qa.py function mk_qa_dataloader (line 36) | def mk_qa_dataloader(task_type, anno_path, lmdb_dir, cfg, tokenizer, function setup_dataloaders (line 136) | def setup_dataloaders(cfg, tokenizer): function setup_model (line 156) | def setup_model(cfg, device=None): function forward_step (line 214) | def forward_step(model, batch, cfg): function validate (line 225) | def validate(model, val_loader, cfg, train_global_step, eval_score=True): function start_training (line 373) | def start_training(cfg): function start_inference (line 567) | def start_inference(cfg): FILE: src/tasks/run_video_retrieval.py function mk_video_ret_datalist (line 40) | def mk_video_ret_datalist(raw_datalist, cfg): function mk_video_ret_dataloader (line 69) | def mk_video_ret_dataloader(anno_path, lmdb_dir, cfg, tokenizer, is_trai... function mk_video_ret_eval_dataloader (line 130) | def mk_video_ret_eval_dataloader(anno_path, lmdb_dir, cfg, tokenizer): function setup_dataloaders (line 176) | def setup_dataloaders(cfg, tokenizer): function setup_model (line 194) | def setup_model(cfg, device=None): function forward_step (line 244) | def forward_step(model, batch): function forward_inference_step (line 249) | def forward_inference_step(model, batch): function validate (line 254) | def validate(model, val_loader, eval_loader, cfg, train_global_step, eva... function start_training (line 302) | def start_training(cfg): function get_retrieval_metric_from_bool_matrix (line 515) | def get_retrieval_metric_from_bool_matrix(bool_matrix): function get_retrieval_scores (line 542) | def get_retrieval_scores(score_matrix, gt_row2col_id_mapping, row_idx2id... function eval_retrieval (line 559) | def eval_retrieval(vid_txt_score_dicts, gt_txt_id2vid_id, id2data): function inference_retrieval (line 633) | def inference_retrieval(model, val_loader, eval_file_path, cfg): function start_inference (line 741) | def start_inference(cfg): FILE: src/utils/basic_utils.py function load_pickle (line 10) | def load_pickle(filename): function save_pickle (line 15) | def save_pickle(data, filename): function load_json (line 20) | def load_json(filename): function save_json (line 25) | def save_json(data, filename, save_pretty=False, sort_keys=False): function load_jsonl (line 33) | def load_jsonl(filename): function save_jsonl (line 38) | def save_jsonl(data, filename): function concat_json_list (line 44) | def concat_json_list(filepaths, save_path): function save_lines (line 51) | def save_lines(list_of_str, filepath): function read_lines (line 56) | def read_lines(filepath): function mkdirp (line 61) | def mkdirp(p): function flat_list_of_lists (line 66) | def flat_list_of_lists(l): function convert_to_seconds (line 71) | def convert_to_seconds(hms_time): function get_video_name_from_url (line 80) | def get_video_name_from_url(url): function merge_dicts (line 84) | def merge_dicts(list_dicts): function l2_normalize_np_array (line 91) | def l2_normalize_np_array(np_array, eps=1e-5): function make_zipfile (line 96) | def make_zipfile(src_dir, save_path, enclosing_dir="", exclude_dirs=None... class AverageMeter (line 127) | class AverageMeter(object): method __init__ (line 129) | def __init__(self): method reset (line 138) | def reset(self): method update (line 146) | def update(self, val, n=1): function dissect_by_lengths (line 155) | def dissect_by_lengths(np_array, lengths, dim=0, assert_equal=True): function get_ratio_from_counter (line 174) | def get_ratio_from_counter(counter_obj, threshold=200): function get_rounded_percentage (line 181) | def get_rounded_percentage(float_number, n_floats=2): function read_dataframe (line 185) | def read_dataframe(pkl_path): function save_frames_grid (line 189) | def save_frames_grid(img_array, out_path): FILE: src/utils/distributed.py function all_reduce_and_rescale_tensors (line 17) | def all_reduce_and_rescale_tensors(tensors, rescale_denom): function all_reduce_and_rescale_tensors_chunked (line 46) | def all_reduce_and_rescale_tensors_chunked(tensors, rescale_denom, function broadcast_tensors (line 99) | def broadcast_tensors(tensors, root_rank, buffer_size=10485760): function all_gather_list (line 149) | def all_gather_list(data, max_size=4096): function any_broadcast (line 181) | def any_broadcast(data, root_rank, max_size=4096): function allgather_object (line 206) | def allgather_object(obj, name=None): FILE: src/utils/grad_ckpt.py function detach_variable (line 5) | def detach_variable(inputs): function check_backward_validity (line 18) | def check_backward_validity(inputs): class CheckpointFunction (line 23) | class CheckpointFunction(torch.autograd.Function): method forward (line 25) | def forward(ctx, run_function, length, *args): method backward (line 34) | def backward(ctx, *output_grads): FILE: src/utils/load_save.py function save_training_meta (line 19) | def save_training_meta(args): class ModelSaver (line 45) | class ModelSaver(object): method __init__ (line 46) | def __init__(self, output_dir): method save (line 50) | def save(self, step, model, optimizer=None, prefix="model"): function load_state_dict_with_pos_embed_resizing (line 73) | def load_state_dict_with_pos_embed_resizing(model, loaded_state_dict_or_... function compare_dict_difference (line 138) | def compare_dict_difference(dict1, dict2, dict1_name="dict1", function _to_cuda (line 179) | def _to_cuda(state): function _to_cpu (line 197) | def _to_cpu(state): class TrainingRestorer (line 215) | class TrainingRestorer(object): method __init__ (line 217) | def __init__(self, opts, **ckpt_dict): method step (line 244) | def step(self): method save (line 257) | def save(self): method restore (line 267) | def restore(self): class E2E_TrainingRestorer (line 280) | class E2E_TrainingRestorer(object): method __init__ (line 281) | def __init__(self, opts, model, optimizer): method step (line 313) | def step(self): method save (line 326) | def save(self): method restore (line 336) | def restore(self, opts): FILE: src/utils/logger.py function add_log_to_file (line 15) | def add_log_to_file(log_path): class TensorboardLogger (line 22) | class TensorboardLogger(object): method __init__ (line 23) | def __init__(self): method create (line 27) | def create(self, path): method noop (line 30) | def noop(self, *args, **kwargs): method step (line 33) | def step(self): method global_step (line 37) | def global_step(self): method global_step (line 41) | def global_step(self, step): method log_scalar_dict (line 44) | def log_scalar_dict(self, log_dict, prefix=''): method __getattr__ (line 58) | def __getattr__(self, name): class RunningMeter (line 67) | class RunningMeter(object): method __init__ (line 71) | def __init__(self, name, val=None, smooth=0.99): method __call__ (line 76) | def __call__(self, value): method __str__ (line 80) | def __str__(self): method val (line 84) | def val(self): method name (line 88) | def name(self): FILE: src/utils/misc.py class NoOp (line 12) | class NoOp(object): method __getattr__ (line 14) | def __getattr__(self, name): method noop (line 17) | def noop(self, *args, **kwargs): function set_random_seed (line 21) | def set_random_seed(seed): function zero_none_grad (line 28) | def zero_none_grad(model):