Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/SooLab/CGFormer
/ functions
Functions
468 in github.com/SooLab/CGFormer
⨍
Functions
468
◇
Types & classes
79
↓ 1 callers
Function
_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 callers
Function
_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 callers
Function
_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 callers
Function
_process_mmcls_checkpoint
(checkpoint)
model/mmcv_custom/checkpoint.py:215
↓ 1 callers
Method
_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 callers
Method
_reorder_cache
(past: Tuple, beam_idx: Tensor)
bert/generation_utils.py:844
↓ 1 callers
Method
_resize_token_embeddings
(self, new_num_tokens)
bert/modeling_utils.py:403
↓ 1 callers
Method
_run_split_on_punc
Splits punctuation on a piece of text.
bert/tokenization_bert.py:414
↓ 1 callers
Method
_run_strip_accents
Strips accents from a piece of text.
bert/tokenization_bert.py:403
↓ 1 callers
Function
_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 callers
Method
_tie_or_clone_weights
Tie or clone module weights depending of whether we are using TorchScript or not
bert/modeling_utils.py:358
↓ 1 callers
Method
_tokenize_chinese_chars
Adds whitespace around any CJK character.
bert/tokenization_bert.py:436
↓ 1 callers
Function
_tokens_match
(prev_tokens, tokens)
bert/generation_utils.py:874
↓ 1 callers
Method
adjust_logits_during_generation
(self, logits, **kwargs)
bert/generation_utils.py:36
↓ 1 callers
Function
basic_clean
(text)
utils/simple_tokenizer.py:50
↓ 1 callers
Method
batch_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 callers
Function
bbox_process
(bbox)
tools/data_process.py:74
↓ 1 callers
Function
box_iou
(boxes1, boxes2)
utils/box_ops.py:44
↓ 1 callers
Method
bpe
(self, token)
utils/simple_tokenizer.py:80
↓ 1 callers
Method
build_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 callers
Method
build_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 callers
Function
build_model
(args)
model/__init__.py:7
↓ 1 callers
Function
calc_banned_bad_words_ids
(prev_input_ids: Iterable[int], bad_words_ids: Iterable[int])
bert/generation_utils.py:871
↓ 1 callers
Function
calc_banned_ngram_tokens
Copied from fairseq for no_repeat_ngram in beam_search
bert/generation_utils.py:848
↓ 1 callers
Function
cat_process
(cat)
tools/data_process.py:52
↓ 1 callers
Method
clean_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 callers
Function
conditional_cast
(from_type, to_type)
utils/config.py:134
↓ 1 callers
Method
convert_to_tensors
(self, tensor_type: Union[None, str, TensorType], prepend_batch_axis: bool = False)
bert/tokenization_utils_base.py:476
↓ 1 callers
Function
count_parameters
(model)
tools/latency.py:34
↓ 1 callers
Method
createIndex
(self)
tools/refer.py:76
↓ 1 callers
Method
create_token_type_ids_from_sequences
(self, token_ids_0: List, token_ids_1: Optional[List] = None)
bert/tokenization_utils_base.py:1964
↓ 1 callers
Method
decode
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 callers
Function
default_bpe
()
utils/simple_tokenizer.py:11
↓ 1 callers
Method
display
(self, batch)
utils/misc.py:105
↓ 1 callers
Method
enforce_repetition_penalty_
repetition penalty (from CTRL paper https://arxiv.org/abs/1909.05858).
bert/generation_utils.py:47
↓ 1 callers
Function
find_pruneable_heads_and_indices
( heads: List, n_heads: int, head_size: int, already_pruned_heads: set )
bert/modeling_utils.py:59
↓ 1 callers
Function
folder2lmdb
(json_data, img_dir, mask_dir, output_dir, split, write_frequency=1000)
tools/folder2lmdb.py:35
↓ 1 callers
Method
from_dict
Constructs a `Config` from a Python dictionary of parameters. Args: config_dict (:obj:`Dict[str, any]`):
bert/configuration_utils.py:269
↓ 1 callers
Method
getImgIds
(self, ref_ids=[])
tools/refer.py:197
↓ 1 callers
Function
get_activation
(activation_string)
bert/activations.py:52
↓ 1 callers
Method
get_added_vocab
(self)
bert/tokenization_utils.py:178
↓ 1 callers
Function
get_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 callers
Method
get_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 callers
Function
get_deprecated_model_names
()
model/mmcv_custom/checkpoint.py:206
↓ 1 callers
Method
get_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 callers
Function
get_external_models
()
model/mmcv_custom/checkpoint.py:185
↓ 1 callers
Function
get_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 callers
Method
get_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 callers
Function
get_mmcls_models
()
model/mmcv_custom/checkpoint.py:199
↓ 1 callers
Method
get_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 callers
Method
get_output_embeddings
(self)
bert/modeling_bert.py:904
↓ 1 callers
Function
get_parser
()
train.py:34
↓ 1 callers
Function
get_parser
()
test.py:21
↓ 1 callers
Function
get_parser
()
tools/latency.py:15
↓ 1 callers
Method
get_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 callers
Function
get_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 callers
Function
gumbel_softmax
(logits: torch.Tensor, tau: float = 1, dim: int = -2)
model/layers.py:48
↓ 1 callers
Function
http_get
(url, temp_file, proxies=None, resume_size=0, user_agent: Union[Dict, str, None] = None)
bert/file_utils.py:617
↓ 1 callers
Function
inference
(test_loader, model, args)
engine/engine.py:149
↓ 1 callers
Function
init_random_seed
Initialize random seed.
utils/misc.py:14
↓ 1 callers
Method
invert_attention_mask
type: torch.Tensor -> torch.Tensor
bert/modeling_utils.py:162
↓ 1 callers
Method
is_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 callers
Method
loadImgs
(self, image_ids=[])
tools/refer.py:222
↓ 1 callers
Method
loadRefs
(self, ref_ids=[])
tools/refer.py:210
↓ 1 callers
Function
load_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 callers
Function
load_fileclient_dist
In distributed setting, this function only download checkpoint at local rank 0.
model/mmcv_custom/checkpoint.py:152
↓ 1 callers
Function
load_pavimodel_dist
In distributed setting, this function only download checkpoint at local rank 0.
model/mmcv_custom/checkpoint.py:124
↓ 1 callers
Function
load_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 callers
Function
load_vocab
Loads a vocabulary file into a dictionary.
bert/tokenization_bert.py:97
↓ 1 callers
Function
main
()
train.py:55
↓ 1 callers
Function
main
()
test.py:41
↓ 1 callers
Function
main
()
tools/latency.py:38
↓ 1 callers
Function
parse_args
()
tools/folder2lmdb.py:70
↓ 1 callers
Function
prepare_dataset
(dataset, splits, output_dir, generate_mask=False)
tools/data_process.py:82
↓ 1 callers
Method
prepare_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 callers
Function
prune_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 callers
Method
prune_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 callers
Method
prune_heads
(self, heads)
bert/modeling_bert.py:287
↓ 1 callers
Function
redirect_sys_output
(log_level="INFO")
utils/misc.py:257
↓ 1 callers
Method
reset
(self)
utils/misc.py:79
↓ 1 callers
Method
reset_memory_hooks_state
(self)
bert/modeling_utils.py:120
↓ 1 callers
Method
sanitize_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 callers
Method
save_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 callers
Method
set_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 callers
Function
set_random_seed
Set random seed.
utils/misc.py:34
↓ 1 callers
Method
showRef
(self, ref, seg_box='seg')
tools/refer.py:239
↓ 1 callers
Function
sigmoid_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 callers
Method
to_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 callers
Method
to_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 callers
Function
train
(train_loader, model, optimizer, scheduler, scaler, epoch, args)
engine/engine.py:16
↓ 1 callers
Method
train
Convert the model into training mode while keep layers freezed.
model/backbone.py:491
↓ 1 callers
Function
trainMetricGPU
(output, target, threshold=0.35, pr_iou=0.5)
utils/misc.py:116
↓ 1 callers
Method
truncate_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 callers
Function
url_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 callers
Function
validate
(val_loader, model, epoch, args)
engine/engine.py:91
↓ 1 callers
Function
weights_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 callers
Function
whitespace_clean
(text)
utils/simple_tokenizer.py:56
↓ 1 callers
Function
window_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 callers
Method
with_pe
(self, vis, pe)
model/layers.py:270
Function
ValMetricGPU
(output, target, threshold=0.35)
utils/misc.py:133
← previous
next →
101–200 of 468, ranked by callers