MCPcopy Create free account

hub / github.com/SooLab/CGFormer / functions

Functions468 in github.com/SooLab/CGFormer

↓ 1 callersFunction_is_end_of_word
Checks whether the last character in text is one of a punctuation, control or whitespace character.
bert/tokenization_utils.py:86
↓ 1 callersFunction_is_start_of_word
Checks whether the first character in text is one of a punctuation, control or whitespace character.
bert/tokenization_utils.py:92
↓ 1 callersFunction_load_checkpoint
Load checkpoint from somewhere (modelzoo, file, url). Args: filename (str): Accept local filepath, URL, ``torchvision://xxx``,
model/mmcv_custom/checkpoint.py:226
↓ 1 callersFunction_process_mmcls_checkpoint
(checkpoint)
model/mmcv_custom/checkpoint.py:215
↓ 1 callersMethod_prune_heads
Prunes heads of the model. heads_to_prune: dict of {layer_num: list of heads to prune in this layer} See base class PreTraine
bert/modeling_bert.py:660
↓ 1 callersMethod_reorder_cache
(past: Tuple, beam_idx: Tensor)
bert/generation_utils.py:844
↓ 1 callersMethod_resize_token_embeddings
(self, new_num_tokens)
bert/modeling_utils.py:403
↓ 1 callersMethod_run_split_on_punc
Splits punctuation on a piece of text.
bert/tokenization_bert.py:414
↓ 1 callersMethod_run_strip_accents
Strips accents from a piece of text.
bert/tokenization_bert.py:403
↓ 1 callersFunction_save_to_state_dict
Saves module state to `destination` dictionary. This method is modified from :meth:`torch.nn.Module._save_to_state_dict`. Args: modu
model/mmcv_custom/checkpoint.py:378
↓ 1 callersMethod_tie_or_clone_weights
Tie or clone module weights depending of whether we are using TorchScript or not
bert/modeling_utils.py:358
↓ 1 callersMethod_tokenize_chinese_chars
Adds whitespace around any CJK character.
bert/tokenization_bert.py:436
↓ 1 callersFunction_tokens_match
(prev_tokens, tokens)
bert/generation_utils.py:874
↓ 1 callersMethodadjust_logits_during_generation
(self, logits, **kwargs)
bert/generation_utils.py:36
↓ 1 callersFunctionbasic_clean
(text)
utils/simple_tokenizer.py:50
↓ 1 callersMethodbatch_encode_plus
Returns a dictionary containing the encoded sequence or sequence pair and additional information: the mask for sequence classificatio
bert/tokenization_utils_base.py:1764
↓ 1 callersFunctionbbox_process
(bbox)
tools/data_process.py:74
↓ 1 callersFunctionbox_iou
(boxes1, boxes2)
utils/box_ops.py:44
↓ 1 callersMethodbpe
(self, token)
utils/simple_tokenizer.py:80
↓ 1 callersMethodbuild_inputs_with_special_tokens
Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and adding special tokens
bert/tokenization_bert.py:232
↓ 1 callersMethodbuild_inputs_with_special_tokens
Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and adding special tokens
bert/tokenization_utils_base.py:1969
↓ 1 callersFunctionbuild_model
(args)
model/__init__.py:7
↓ 1 callersFunctioncalc_banned_bad_words_ids
(prev_input_ids: Iterable[int], bad_words_ids: Iterable[int])
bert/generation_utils.py:871
↓ 1 callersFunctioncalc_banned_ngram_tokens
Copied from fairseq for no_repeat_ngram in beam_search
bert/generation_utils.py:848
↓ 1 callersFunctioncat_process
(cat)
tools/data_process.py:52
↓ 1 callersMethodclean_up_tokenization
Clean up a list of simple English tokenization artifacts like spaces before punctuations and abreviated forms.
bert/tokenization_utils_base.py:2302
↓ 1 callersFunctionconditional_cast
(from_type, to_type)
utils/config.py:134
↓ 1 callersMethodconvert_to_tensors
(self, tensor_type: Union[None, str, TensorType], prepend_batch_axis: bool = False)
bert/tokenization_utils_base.py:476
↓ 1 callersFunctioncount_parameters
(model)
tools/latency.py:34
↓ 1 callersMethodcreateIndex
(self)
tools/refer.py:76
↓ 1 callersMethodcreate_token_type_ids_from_sequences
(self, token_ids_0: List, token_ids_1: Optional[List] = None)
bert/tokenization_utils_base.py:1964
↓ 1 callersMethoddecode
Converts a sequence of ids (integer) in a string, using the tokenizer and vocabulary with options to remove special tokens and clean
bert/tokenization_utils_base.py:2256
↓ 1 callersFunctiondefault_bpe
()
utils/simple_tokenizer.py:11
↓ 1 callersMethoddisplay
(self, batch)
utils/misc.py:105
↓ 1 callersMethodenforce_repetition_penalty_
repetition penalty (from CTRL paper https://arxiv.org/abs/1909.05858).
bert/generation_utils.py:47
↓ 1 callersFunctionfind_pruneable_heads_and_indices
( heads: List, n_heads: int, head_size: int, already_pruned_heads: set )
bert/modeling_utils.py:59
↓ 1 callersFunctionfolder2lmdb
(json_data, img_dir, mask_dir, output_dir, split, write_frequency=1000)
tools/folder2lmdb.py:35
↓ 1 callersMethodfrom_dict
Constructs a `Config` from a Python dictionary of parameters. Args: config_dict (:obj:`Dict[str, any]`):
bert/configuration_utils.py:269
↓ 1 callersMethodgetImgIds
(self, ref_ids=[])
tools/refer.py:197
↓ 1 callersFunctionget_activation
(activation_string)
bert/activations.py:52
↓ 1 callersMethodget_added_vocab
(self)
bert/tokenization_utils.py:178
↓ 1 callersFunctionget_caller_name
Args: depth (int): Depth of caller conext, use 0 for caller depth. Default value: 0. Returns: str: module name of th
utils/misc.py:211
↓ 1 callersMethodget_config_dict
From a `pretrained_model_name_or_path`, resolve to a dictionary of parameters, to be used for instantiating a Config using `from_dict
bert/configuration_utils.py:204
↓ 1 callersFunctionget_deprecated_model_names
()
model/mmcv_custom/checkpoint.py:206
↓ 1 callersMethodget_extended_attention_mask
Makes broadcastable attention mask and causal mask so that future and maked tokens are ignored. Arguments: attention_mask: torch.
bert/modeling_utils.py:188
↓ 1 callersFunctionget_external_models
()
model/mmcv_custom/checkpoint.py:185
↓ 1 callersFunctionget_from_cache
Given a URL, look for the corresponding file in the local cache. If it's not there, download it. Then return the path to the cached file.
bert/file_utils.py:650
↓ 1 callersMethodget_head_mask
# Prepare head mask if needed # 1.0 in head_mask indicate we keep the head attention_probs has shape bsz x n_heads x N x N
bert/modeling_utils.py:232
↓ 1 callersFunctionget_mmcls_models
()
model/mmcv_custom/checkpoint.py:199
↓ 1 callersMethodget_output_embeddings
Returns the model's output embeddings. Returns: :obj:`nn.Module`: A torch module mapping hidden states t
bert/modeling_utils.py:338
↓ 1 callersMethodget_output_embeddings
(self)
bert/modeling_bert.py:904
↓ 1 callersFunctionget_parser
()
train.py:34
↓ 1 callersFunctionget_parser
()
test.py:21
↓ 1 callersFunctionget_parser
()
tools/latency.py:15
↓ 1 callersMethodget_special_tokens_mask
Retrieves sequence ids from a token list that has no special tokens added. This method is called when adding special tokens using the
bert/tokenization_utils_base.py:2271
↓ 1 callersFunctionget_state_dict
Returns a dictionary containing a whole state of the module. Both parameters and persistent buffers (e.g. running averages) are included. Key
model/mmcv_custom/checkpoint.py:398
↓ 1 callersFunctiongumbel_softmax
(logits: torch.Tensor, tau: float = 1, dim: int = -2)
model/layers.py:48
↓ 1 callersFunctionhttp_get
(url, temp_file, proxies=None, resume_size=0, user_agent: Union[Dict, str, None] = None)
bert/file_utils.py:617
↓ 1 callersFunctioninference
(test_loader, model, args)
engine/engine.py:149
↓ 1 callersFunctioninit_random_seed
Initialize random seed.
utils/misc.py:14
↓ 1 callersMethodinvert_attention_mask
type: torch.Tensor -> torch.Tensor
bert/modeling_utils.py:162
↓ 1 callersMethodis_done
If there are enough hypotheses and that none of the hypotheses being generated can become better than the worst one in the heap, then
bert/generation_utils.py:980
↓ 1 callersMethodloadImgs
(self, image_ids=[])
tools/refer.py:222
↓ 1 callersMethodloadRefs
(self, ref_ids=[])
tools/refer.py:210
↓ 1 callersFunctionload_checkpoint
Load checkpoint from a file or URI. Args: model (Module): Module to load checkpoint. filename (str): Accept local filepath, URL,
model/mmcv_custom/checkpoint.py:287
↓ 1 callersFunctionload_fileclient_dist
In distributed setting, this function only download checkpoint at local rank 0.
model/mmcv_custom/checkpoint.py:152
↓ 1 callersFunctionload_pavimodel_dist
In distributed setting, this function only download checkpoint at local rank 0.
model/mmcv_custom/checkpoint.py:124
↓ 1 callersFunctionload_state_dict
Load state_dict to a module. This method is modified from :meth:`torch.nn.Module.load_state_dict`. Default value for ``strict`` is set to ``F
model/mmcv_custom/checkpoint.py:41
↓ 1 callersFunctionload_vocab
Loads a vocabulary file into a dictionary.
bert/tokenization_bert.py:97
↓ 1 callersFunctionmain
()
train.py:55
↓ 1 callersFunctionmain
()
test.py:41
↓ 1 callersFunctionmain
()
tools/latency.py:38
↓ 1 callersFunctionparse_args
()
tools/folder2lmdb.py:70
↓ 1 callersFunctionprepare_dataset
(dataset, splits, output_dir, generate_mask=False)
tools/data_process.py:82
↓ 1 callersMethodprepare_for_tokenization
Performs any necessary transformations before tokenization. This method should pop the arguments from kwargs and return kwargs as well.
bert/tokenization_utils.py:623
↓ 1 callersFunctionprune_conv1d_layer
Prune a Conv1D layer (a model parameters) to keep only entries in index. A Conv1D work as a Linear layer (see e.g. BERT) but the weights are
bert/modeling_utils.py:1171
↓ 1 callersMethodprune_heads
Prunes heads of the base model. Arguments: heads_to_prune: dict with keys being selected layer indices (`int`) and asso
bert/modeling_utils.py:459
↓ 1 callersMethodprune_heads
(self, heads)
bert/modeling_bert.py:287
↓ 1 callersFunctionredirect_sys_output
(log_level="INFO")
utils/misc.py:257
↓ 1 callersMethodreset
(self)
utils/misc.py:79
↓ 1 callersMethodreset_memory_hooks_state
(self)
bert/modeling_utils.py:120
↓ 1 callersMethodsanitize_special_tokens
Make sure that all the special tokens attributes of the tokenizer (tokenizer.mask_token, tokenizer.cls_token, ...) are in the vocabulary.
bert/tokenization_utils_base.py:610
↓ 1 callersMethodsave_vocabulary
Save the sentencepiece vocabulary (copy original file) and special tokens file to a directory. Args: vocab_path (:obj:`s
bert/tokenization_bert.py:319
↓ 1 callersMethodset_input_embeddings
Set model's input embeddings Args: value (:obj:`nn.Module`): A module mapping vocabulary to hidden state
bert/modeling_utils.py:324
↓ 1 callersFunctionset_random_seed
Set random seed.
utils/misc.py:34
↓ 1 callersMethodshowRef
(self, ref, seg_box='seg')
tools/refer.py:239
↓ 1 callersFunctionsigmoid_focal_loss
Loss used in RetinaNet for dense detection: https://arxiv.org/abs/1708.02002. Args: inputs: A float tensor of arbitrary shape.
model/segmenter.py:26
↓ 1 callersMethodto_diff_dict
Removes all attributes from config which correspond to the default config attributes for better readability and serializes to a Pytho
bert/configuration_utils.py:334
↓ 1 callersMethodto_json_file
Save this instance to a json file. Args: json_file_path (:obj:`string`): Path to the JSON file in which
bert/configuration_utils.py:386
↓ 1 callersFunctiontrain
(train_loader, model, optimizer, scheduler, scaler, epoch, args)
engine/engine.py:16
↓ 1 callersMethodtrain
Convert the model into training mode while keep layers freezed.
model/backbone.py:491
↓ 1 callersFunctiontrainMetricGPU
(output, target, threshold=0.35, pr_iou=0.5)
utils/misc.py:116
↓ 1 callersMethodtruncate_sequences
Truncates a sequence pair in place to the maximum length. Args: ids: list of tokenized input ids. Can be obtained from a string
bert/tokenization_utils_base.py:2103
↓ 1 callersFunctionurl_to_filename
Convert `url` into a hashed filename in a repeatable way. If `etag` is specified, append its hash to the url's, delimited by a period.
bert/file_utils.py:475
↓ 1 callersFunctionvalidate
(val_loader, model, epoch, args)
engine/engine.py:91
↓ 1 callersFunctionweights_to_cpu
Copy a model state_dict to cpu. Args: state_dict (OrderedDict): Model weights on GPU. Returns: OrderedDict: Model weights on
model/mmcv_custom/checkpoint.py:363
↓ 1 callersFunctionwhitespace_clean
(text)
utils/simple_tokenizer.py:56
↓ 1 callersFunctionwindow_reverse
Args: windows: (num_windows*B, window_size, window_size, C) window_size (int): Window size H (int): Height of image
model/backbone.py:48
↓ 1 callersMethodwith_pe
(self, vis, pe)
model/layers.py:270
FunctionValMetricGPU
(output, target, threshold=0.35)
utils/misc.py:133
← previousnext →101–200 of 468, ranked by callers