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
↓ 46 callers
Method
items
(self)
bert/tokenization_utils_base.py:205
↓ 22 callers
Method
__init__
(self, config)
bert/modeling_bert.py:352
↓ 19 callers
Method
keys
(self)
bert/tokenization_utils_base.py:199
↓ 17 callers
Method
convert_tokens_to_ids
Converts a token string (or a sequence of tokens) in a single integer id (or a sequence of ids), using the vocabulary.
bert/tokenization_utils.py:376
↓ 16 callers
Method
load
(module: nn.Module, prefix="")
bert/modeling_utils.py:736
↓ 16 callers
Method
to
Send all values to device by calling v.to(device)
bert/tokenization_utils_base.py:522
↓ 11 callers
Method
update
(self, val, n=1)
utils/misc.py:85
↓ 9 callers
Method
__init__
(self, in_features, hidden_features=None, out_features=None, act_layer=nn.GELU, drop=0.)
model/backbone.py:15
↓ 9 callers
Method
init_weights
Initialize and prunes weights if needed.
bert/modeling_utils.py:447
↓ 8 callers
Method
__init__
(self, in_features, hidden_features=None, out_features=None, act_layer=nn.GELU, drop=0.)
model/layers.py:18
↓ 8 callers
Method
values
(self)
bert/tokenization_utils_base.py:202
↓ 7 callers
Method
__init__
Conv1D layer as defined by Radford et al. for OpenAI GPT (and also used in GPT-2) Basically works like a Linear layer but the weights are
bert/modeling_utils.py:816
↓ 7 callers
Method
pad
Pad a single encoded input or a batch of encoded inputs up to predefined length or to the max sequence length in the batch. Padding side
bert/tokenization_utils_base.py:1864
↓ 6 callers
Method
write
(self, buf)
utils/misc.py:243
↓ 5 callers
Method
add
Add a new hypothesis to the list.
bert/generation_utils.py:966
↓ 5 callers
Method
getRefIds
(self, image_ids=[], cat_ids=[], ref_ids=[], split='')
tools/refer.py:140
↓ 5 callers
Function
load_url_dist
In distributed setting, this function only download checkpoint at local rank 0.
model/mmcv_custom/checkpoint.py:110
↓ 5 callers
Method
num_special_tokens_to_add
(self, pair: bool = False)
bert/tokenization_utils_base.py:1430
↓ 5 callers
Function
prune_linear_layer
Prune a linear layer (a model parameters) to keep only entries in index. Return the pruned layer as a new layer with requires_grad=True.
bert/modeling_utils.py:1146
↓ 4 callers
Method
_get_padding_truncation_strategies
Find the correct padding/truncation strategy with backward compatibility for old arguments (truncation_strategy and pad_to_max_length) an
bert/tokenization_utils_base.py:1433
↓ 4 callers
Method
add_tokens
Add a list of new tokens to the tokenizer class. If the new tokens are not in the vocabulary, they are added to it with indices start
bert/tokenization_utils_base.py:680
↓ 4 callers
Method
convert
(self, img, mask, sent, inference=False)
utils/dataset.py:164
↓ 4 callers
Method
encode
(self, text)
utils/simple_tokenizer.py:121
↓ 4 callers
Function
is_remote_url
(url_or_filename)
bert/file_utils.py:446
↓ 4 callers
Function
is_tf_available
()
bert/file_utils.py:135
↓ 4 callers
Function
is_torch_available
()
bert/file_utils.py:131
↓ 4 callers
Function
load
(module, prefix='')
model/mmcv_custom/checkpoint.py:67
↓ 4 callers
Method
tokenize
Converts a string in a sequence of tokens (string), using the tokenizer. Split in words for word-based vocabulary or sub-words for sub-wo
bert/tokenization_utils.py:256
↓ 4 callers
Method
update
Updates attributes of this class with attributes from `config_dict`. Args: :obj:`Dict[str, any]`: Dictionary of
bert/configuration_utils.py:399
↓ 3 callers
Function
_is_control
Checks whether `chars` is a control character.
bert/tokenization_utils.py:59
↓ 3 callers
Function
_is_punctuation
Checks whether `chars` is a punctuation character.
bert/tokenization_utils.py:71
↓ 3 callers
Function
_is_whitespace
Checks whether `chars` is a whitespace character.
bert/tokenization_utils.py:47
↓ 3 callers
Function
build_segmenter
(args, DDP=True, OPEN=False)
model/__init__.py:60
↓ 3 callers
Function
cached_path
Given something that might be a URL (or might be a local path), determine which. If it's a URL, download the file and cache it, and retur
bert/file_utils.py:525
↓ 3 callers
Function
concat_all_gather
Performs all_gather operation on the provided tensors. *** Warning ***: torch.distributed.all_gather has no gradient.
utils/misc.py:46
↓ 3 callers
Method
convert
(self, img, mask, sent, inference=False)
utils/dataset_open.py:178
↓ 3 callers
Method
decode
(self, tokens)
utils/simple_tokenizer.py:129
↓ 3 callers
Function
dumps_pyarrow
Serialize an object. Returns: Implementation-dependent bytes-like object
tools/folder2lmdb.py:26
↓ 3 callers
Method
get_input_embeddings
Returns the model's input embeddings. Returns: :obj:`nn.Module`: A torch module mapping vocabulary to hi
bert/modeling_utils.py:310
↓ 3 callers
Function
hf_bucket_url
Resolve a model identifier, and a file name, to a HF-hosted url on either S3 or Cloudfront (a Content Delivery Network, or CDN). Cloudfr
bert/file_utils.py:451
↓ 3 callers
Function
loads_pyarrow
Args: buf: the output of `dumps`.
utils/dataset.py:77
↓ 3 callers
Function
loads_pyarrow
Args: buf: the output of `dumps`.
utils/dataset_open.py:90
↓ 3 callers
Method
tie_weights
Tie the weights between the input embeddings and the output embeddings. If the `torchscript` flag is set in the configuration, can't
bert/modeling_utils.py:348
↓ 3 callers
Method
to_dict
Serializes this instance to a Python dictionary. Returns: :obj:`Dict[str, any]`: Dictionary of all the attributes that m
bert/configuration_utils.py:357
↓ 3 callers
Function
tokenize
Returns the tokenized representation of given input string(s) Parameters ---------- texts : Union[str, List[str]] An input s
utils/dataset.py:43
↓ 3 callers
Function
tokenize
Returns the tokenized representation of given input string(s) Parameters ---------- texts : Union[str, List[str]] An input s
utils/dataset_open.py:46
↓ 3 callers
Method
tokenize
Basic Tokenization of a piece of text. Split on "white spaces" only, for sub-word tokenization, see WordPieceTokenizer. Args:
bert/tokenization_bert.py:371
↓ 3 callers
Method
transpose_for_scores
(self, x)
bert/modeling_bert.py:207
↓ 3 callers
Function
whitespace_tokenize
Runs basic whitespace cleaning and splitting on a piece of text.
bert/tokenization_bert.py:108
↓ 2 callers
Method
_convert_id_to_token
(self, index: int)
bert/tokenization_utils.py:675
↓ 2 callers
Method
_convert_token_to_id_with_added_voc
(self, token)
bert/tokenization_utils.py:391
↓ 2 callers
Method
_dict_from_json_file
(cls, json_file: str)
bert/configuration_utils.py:323
↓ 2 callers
Method
_freeze_stages
(self)
model/backbone.py:420
↓ 2 callers
Function
_get_mmcv_home
()
model/mmcv_custom/checkpoint.py:30
↓ 2 callers
Method
_pad
Pad encoded inputs (on left/right and up to predefined legnth or max length in the batch) Args: encoded_inputs: Dictionary of to
bert/tokenization_utils_base.py:2183
↓ 2 callers
Method
_tokenize
Converts a string in a sequence of tokens (string), using the tokenizer. Split in words for word-based vocabulary or sub-words for sub-wo
bert/tokenization_utils.py:367
↓ 2 callers
Method
_use_cache
During generation, decide whether to pass the `past` variable to the next forward pass.
bert/generation_utils.py:39
↓ 2 callers
Function
bytes_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
utils/simple_tokenizer.py:16
↓ 2 callers
Function
conv_layer
(in_dim, out_dim, kernel_size=1, padding=0, stride=1)
model/layers.py:35
↓ 2 callers
Method
convert_ids_to_tokens
Converts a single index or a sequence of indices (integers) in a token " (resp.) a sequence of tokens (str), using the vocabulary and add
bert/tokenization_utils.py:650
↓ 2 callers
Method
convert_tokens_to_string
Converts a sequence of tokens (string) in a single string. The most simple way to do it is ' '.join(self.convert_ids_to_tokens(token_ids)
bert/tokenization_utils.py:678
↓ 2 callers
Function
dice_loss
Compute the DICE loss, similar to generalized IOU for masks Args: inputs: A float tensor of arbitrary shape. The pred
model/segmenter.py:7
↓ 2 callers
Method
encode
Converts a string in a sequence of ids (integer), using the tokenizer and vocabulary. Same as doing ``self.convert_tokens_to_ids(sel
bert/tokenization_utils_base.py:1389
↓ 2 callers
Method
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:1673
↓ 2 callers
Method
flush
(self)
utils/misc.py:253
↓ 2 callers
Method
from_pretrained
r"""Instantiate a pretrained pytorch model from a pre-trained model configuration. The model is set in evaluation mode by default using ``mod
bert/modeling_utils.py:510
↓ 2 callers
Method
getMask
(self, ref)
tools/refer.py:295
↓ 2 callers
Method
getRefBox
(self, ref_id)
tools/refer.py:234
↓ 2 callers
Function
get_pairs
Return set of symbol pairs in a word. Word is represented as tuple of symbols (symbols being variable-length strings).
utils/simple_tokenizer.py:38
↓ 2 callers
Function
get_torchvision_models
()
model/mmcv_custom/checkpoint.py:173
↓ 2 callers
Method
init_weights
Initialize the weights in backbone. Args: pretrained (str, optional): Path to pre-trained weights. Defaults to No
model/backbone.py:437
↓ 2 callers
Function
l2norm
L2-normalize columns of X
model/layers.py:7
↓ 2 callers
Method
postprocess_next_token_scores
( self, scores, input_ids, no_repeat_ngram_size, bad_words_ids,
bert/generation_utils.py:57
↓ 2 callers
Method
prepare_for_model
Prepares a sequence of input id, or a pair of sequences of inputs ids so that it can be used by the model. It adds special tokens, truncates
bert/tokenization_utils_base.py:1979
↓ 2 callers
Method
prepare_inputs_for_generation
(self, input_ids, **kwargs)
bert/generation_utils.py:33
↓ 2 callers
Function
raw_reader
(path)
tools/folder2lmdb.py:20
↓ 2 callers
Function
setup_logger
setup logger for training and testing. Args: save_dir(str): location to save log file distributed_rank(int): device rank when mult
utils/misc.py:263
↓ 2 callers
Method
to_json_string
Serializes this instance to a JSON string. Args: use_diff (:obj:`bool`): If set to True, only the differ
bert/configuration_utils.py:369
↓ 2 callers
Function
top_k_top_p_filtering
Filter a distribution of logits using top-k and/or nucleus (top-p) filtering Args: logits: logits distribution shape (batch size,
bert/generation_utils.py:907
↓ 2 callers
Function
window_partition
Args: x: (B, H, W, C) window_size (int): window size Returns: windows: (num_windows*B, window_size, window_size, C)
model/backbone.py:33
↓ 1 callers
Method
__getstate__
(self)
bert/tokenization_utils_base.py:189
↓ 1 callers
Method
__init__
( self, data: Optional[Dict[str, Any]] = None, encoding: Optional[Union[EncodingFast,
bert/tokenization_utils_base.py:145
↓ 1 callers
Method
_add_tokens
Add a list of new tokens to the tokenizer class. If the new tokens are not in the vocabulary, they are added to it with indices start
bert/tokenization_utils.py:185
↓ 1 callers
Method
_batch_encode_plus
( self, batch_text_or_text_pairs: Union[ List[TextInput], List[TextInp
bert/tokenization_utils_base.py:1835
↓ 1 callers
Method
_batch_prepare_for_model
Prepares a sequence of input id, or a pair of sequences of inputs ids so that it can be used by the model. It adds special tokens, truncates
bert/tokenization_utils.py:560
↓ 1 callers
Function
_check_and_coerce_cfg_value_type
Checks that `replacement`, which is intended to replace `original` is of the right type. The type is correct if it matches exactly or is one of a
utils/config.py:120
↓ 1 callers
Method
_convert_head_mask_to_5d
-> [num_hidden_layers x batch x num_heads x seq_length x seq_length]
bert/modeling_utils.py:253
↓ 1 callers
Method
_convert_token_to_id
(self, token)
bert/tokenization_utils.py:399
↓ 1 callers
Function
_decode_cfg_value
Decodes a raw config value (e.g., from a yaml config files or command line argument) into a Python object.
utils/config.py:91
↓ 1 callers
Method
_encode_plus
( self, text: Union[TextInput, PreTokenizedInput, EncodedInput], text_pair: Optional[U
bert/tokenization_utils_base.py:1740
↓ 1 callers
Method
_from_pretrained
(cls, pretrained_model_name_or_path, *init_inputs, **kwargs)
bert/tokenization_utils_base.py:1143
↓ 1 callers
Method
_generate_beam_search
Generate sequences for each example with beam search.
bert/generation_utils.py:585
↓ 1 callers
Method
_generate_no_beam_search
Generate sequences for each example without beam search (num_beams == 1). All returned sequence are generated independantly.
bert/generation_utils.py:485
↓ 1 callers
Method
_get_batch_fmtstr
(self, num_batches)
utils/misc.py:110
↓ 1 callers
Function
_get_generated_ngrams
(hypo_idx)
bert/generation_utils.py:861
↓ 1 callers
Method
_get_resized_embeddings
Build a resized Embedding Module from a provided token Embedding Module. Increasing the size will add newly initialized vectors at the en
bert/modeling_utils.py:409
↓ 1 callers
Method
_init_db
(self)
utils/dataset.py:103
↓ 1 callers
Method
_init_db
(self)
utils/dataset_open.py:114
↓ 1 callers
Method
_init_weights
Initialize the weights
bert/modeling_bert.py:551
↓ 1 callers
Method
_is_chinese_char
Checks whether CP is the codepoint of a CJK character.
bert/tokenization_bert.py:449
next →
1–100 of 468, ranked by callers