MCPcopy Create free account

hub / github.com/SooLab/CGFormer / functions

Functions468 in github.com/SooLab/CGFormer

Methodadd_special_tokens
Add a dictionary of special tokens (eos, pad, cls...) to the encoder and link them to class attributes. If special tokens are NOT in
bert/tokenization_utils_base.py:619
Functionadd_start_docstrings
(*docstr)
bert/file_utils.py:155
Functionadd_start_docstrings_to_callable
(*docstr)
bert/file_utils.py:163
Methodadditional_special_tokens
All the additional special tokens you may want to use (list of strings). Log an error if used while not having been set.
bert/tokenization_utils_base.py:774
Methodadditional_special_tokens_ids
Ids of all the additional special tokens in the vocabulary (list of integers). Log an error if used while not having been set.
bert/tokenization_utils_base.py:868
Methodall_special_ids
List the vocabulary indices of the special tokens ('<unk>', '<cls>'...) mapped to class attributes (cls_token, unk_token...).
bert/tokenization_utils_base.py:926
Methodall_special_tokens
List all the special tokens ('<unk>', '<cls>'...) mapped to class attributes Convert tokens of AddedToken type in string. All
bert/tokenization_utils_base.py:902
Methodall_special_tokens_extended
List all the special tokens ('<unk>', '<cls>'...) mapped to class attributes Keep the tokens as AddedToken if they are of this type.
bert/tokenization_utils_base.py:912
Functionapply_chunking_to_forward
This function chunks the `input_tensors` into smaller input tensor parts of size `chunk_size` over the dimension `chunk_dim`. It then applies
bert/modeling_utils.py:1208
Methodbase_model
(self)
bert/modeling_utils.py:307
Methodbatch_decode
(self, sequences: List[List[int]], **kwargs)
bert/tokenization_utils_base.py:2253
Methodbos_token
Beginning of sentence token (string). Log an error if used while not having been set.
bert/tokenization_utils_base.py:718
Methodbos_token_id
Id of the beginning of sentence token in the vocabulary. Log an error if used while not having been set.
bert/tokenization_utils_base.py:814
Functionbox_cxcywh_to_xyxy
(x)
utils/box_ops.py:29
Functionbox_xyxy_to_cxcywh
(x)
utils/box_ops.py:36
Functionbuild_scheduler
(config, optimizer, n_iter_per_epoch)
utils/misc.py:297
Methodchar_to_token
Get the index of the token in the encoded output comprising a character in the original string for a sequence of the batch.
bert/tokenization_utils_base.py:362
Methodchar_to_word
Get the word in the original string corresponding to a character in the original string of a sequence of the batch. Can be c
bert/tokenization_utils_base.py:439
Functionclip_iou
(boxes1,boxes2)
utils/box_ops.py:7
Methodcls_token
Classification token (string). E.g. to extract a summary of an input sequence leveraging self-attention along the full depth of the model. Log an err
bert/tokenization_utils_base.py:758
Methodcls_token_id
Id of the classification token in the vocabulary. E.g. to extract a summary of an input sequence leveraging self-attention along the full depth of th
bert/tokenization_utils_base.py:854
Functioncollate_fn
(batch)
utils/misc.py:312
Functioncolorize
(gray, palette)
utils/misc.py:193
Methodconvert_tokens_to_string
Converts a sequence of tokens (string) in a single string.
bert/tokenization_bert.py:227
Methodcreate_custom_forward
(module)
bert/modeling_bert.py:418
Methodcreate_token_type_ids_from_sequences
Creates a mask from the two sequences passed to be used in a sequence-pair classification task. A BERT sequence pair mask has the fol
bert/tokenization_bert.py:289
Methodcustom_forward
(*inputs)
bert/modeling_bert.py:419
Methoddecode
( self, token_ids: List[int], skip_special_tokens: bool = False, clean_up_tokenization_spaces: bool =
bert/tokenization_utils.py:685
Methoddevice
Get torch.device from module, assuming that the whole module has one device.
bert/modeling_utils.py:127
Functiondocstring_decorator
(fn)
bert/file_utils.py:156
Methoddtype
Get torch.dtype from module, assuming that the whole module has one dtype.
bert/modeling_utils.py:145
Methoddummy_inputs
Dummy inputs to do a forward pass in the network. Returns: torch.Tensor with dummy inputs
bert/modeling_utils.py:285
Methodencodings
Return the list all encoding from the tokenization process Returns: List[EncodingFast] or None if input was tokenized through Python
bert/tokenization_utils_base.py:213
Methodeos_token
End of sentence token (string). Log an error if used while not having been set.
bert/tokenization_utils_base.py:726
Methodeos_token_id
Id of the end of sentence token in the vocabulary. Log an error if used while not having been set.
bert/tokenization_utils_base.py:821
Functionfilename_to_url
Return the url and etag (which may be ``None``) stored for `filename`. Raise ``EnvironmentError`` if `filename` or its stored metadata do not
bert/file_utils.py:499
Functionfind_free_port
()
utils/misc.py:200
Methodfind_tensor_attributes
(module: nn.Module)
bert/modeling_utils.py:136
Methodforward
(self, x)
model/layers.py:27
Methodforward
(self, in_1, in_2)
model/layers.py:76
Methodforward
x: b, 512, 104, 104 text: b, 512
model/layers.py:104
Methodforward
(self, query, key, value=None, mask=None)
model/layers.py:158
Methodforward
(self, tokens, text, pad_mask)
model/layers.py:208
Methodforward
(self, tokens, text, pad_mask)
model/layers.py:229
Methodforward
(self, tokens, text, pad_mask)
model/layers.py:249
Methodforward
(self, tokens, vis, pe=None)
model/layers.py:273
Methodforward
(self, vis, text, pad_mask)
model/layers.py:331
Methodforward
(self, x, text, l_mask, mask=None)
model/segmenter.py:62
Methodforward
(self, x)
model/backbone.py:24
Methodforward
Forward function. Args: x: input features with shape of (num_windows*B, N, C) mask: (0/-inf) mask with shape of (num
model/backbone.py:113
Methodforward
Forward function. Args: x: Input feature, tensor size (B, H*W, C). H, W: Spatial resolution of the input feature.
model/backbone.py:188
Methodforward
Forward function. Args: x: Input feature, tensor size (B, H*W, C). H, W: Spatial resolution of the input feature.
model/backbone.py:261
Methodforward
Forward function.
model/backbone.py:315
Methodforward
Forward function.
model/backbone.py:464
Methodforward
Forward function. Args: x: Input feature, tensor size (B, H*W, C). H, W: Spatial resolution of the input feature.
model/backbone.py:564
Methodforward
vis: b c n text: b c n
model/backbone.py:620
Methodforward
(self, x, l, l_mask)
model/backbone.py:669
Methodforward
(self, x, l, l_mask)
model/backbone.py:716
Methodforward
(self, input)
bert/modeling_utils.py:55
Methodforward
(self, x)
bert/modeling_utils.py:827
Methodforward
Args: **p_mask**: (`optional`) ``torch.FloatTensor`` of shape `(batch_size, seq_len)` invalid position mask such as query
bert/modeling_utils.py:841
Methodforward
Args: One of ``start_states``, ``start_positions`` should be not None. If both are set, ``start_positions`` overrides ``start
bert/modeling_utils.py:869
Methodforward
Args: One of ``start_states``, ``start_positions`` should be not None. If both are set, ``start_positions`` overrides
bert/modeling_utils.py:914
Methodforward
( self, hidden_states, start_positions=None, end_positions=None, cls_index=None, is_impossible=None, p
bert/modeling_utils.py:1002
Methodforward
hidden_states: float Tensor in shape [bsz, ..., seq_len, hidden_size], the hidden-states of the last layer. cls_index: [optional] positio
bert/modeling_utils.py:1114
Methodforward
(self, input_ids=None, token_type_ids=None, position_ids=None, inputs_embeds=None)
bert/modeling_bert.py:163
Methodforward
( self, hidden_states, attention_mask=None, head_mask=None, encoder_hi
bert/modeling_bert.py:212
Methodforward
(self, hidden_states, input_tensor)
bert/modeling_bert.py:273
Methodforward
( self, hidden_states, attention_mask=None, head_mask=None, encoder_hi
bert/modeling_bert.py:305
Methodforward
(self, hidden_states)
bert/modeling_bert.py:331
Methodforward
(self, hidden_states, input_tensor)
bert/modeling_bert.py:344
Methodforward
( self, hidden_states, attention_mask=None, head_mask=None, encoder_hi
bert/modeling_bert.py:361
Methodforward
( self, hidden_states, attention_mask=None, head_mask=None, encoder_hi
bert/modeling_bert.py:400
Methodforward
(self, hidden_states)
bert/modeling_bert.py:464
Methodforward
(self, hidden_states)
bert/modeling_bert.py:483
Methodforward
(self, hidden_states)
bert/modeling_bert.py:504
Methodforward
(self, sequence_output)
bert/modeling_bert.py:515
Methodforward
(self, pooled_output)
bert/modeling_bert.py:525
Methodforward
(self, sequence_output, pooled_output)
bert/modeling_bert.py:536
Methodforward
r""" Return: :obj:`tuple(torch.FloatTensor)` comprising various elements depending on the configuration (:class:`~transformers.BertConfig`
bert/modeling_bert.py:670
Methodforward
r""" labels (``torch.LongTensor`` of shape ``(batch_size, sequence_length)``, `optional`, defaults to :obj:`None`): Labels for com
bert/modeling_bert.py:791
Methodforward
r""" labels (:obj:`torch.LongTensor` of shape :obj:`(batch_size, sequence_length)`, `optional`, defaults to :obj:`None`): Labels f
bert/modeling_bert.py:908
Methodforward
r""" labels (:obj:`torch.LongTensor` of shape :obj:`(batch_size, sequence_length)`, `optional`, defaults to :obj:`None`): Labels f
bert/modeling_bert.py:1022
Methodforward
r""" next_sentence_label (:obj:`torch.LongTensor` of shape :obj:`(batch_size,)`, `optional`, defaults to :obj:`None`): Labels for
bert/modeling_bert.py:1126
Methodforward
r""" labels (:obj:`torch.LongTensor` of shape :obj:`(batch_size,)`, `optional`, defaults to :obj:`None`): Labels for computing the
bert/modeling_bert.py:1221
Methodforward
r""" labels (:obj:`torch.LongTensor` of shape :obj:`(batch_size,)`, `optional`, defaults to :obj:`None`): Labels for computing the
bert/modeling_bert.py:1307
Methodforward
r""" labels (:obj:`torch.LongTensor` of shape :obj:`(batch_size, sequence_length)`, `optional`, defaults to :obj:`None`): Labels f
bert/modeling_bert.py:1402
Methodforward
r""" start_positions (:obj:`torch.LongTensor` of shape :obj:`(batch_size,)`, `optional`, defaults to :obj:`None`): Labels for posi
bert/modeling_bert.py:1489
Methodfrom_json_file
Constructs a `Config` from the path to a json file of parameters. Args: json_file (:obj:`string`): Path
bert/configuration_utils.py:307
Methodfrom_pretrained
r""" Instantiate a :class:`~transformers.PreTrainedTokenizer` (or a derived class) from a predefined tokenizer. Args: pre
bert/tokenization_utils_base.py:1088
Methodfrom_pretrained
r""" Instantiate a :class:`~transformers.PretrainedConfig` (or a derived class) from a pre-trained model configuration. Args:
bert/configuration_utils.py:145
Functiongelu_fast
(x)
bert/activations.py:38
Functiongelu_new
Implementation of the gelu activation function currently in Google Bert repo (identical to OpenAI GPT). Also see https://arxiv.org/abs/1606.0
bert/activations.py:25
Functiongeneralized_box_iou
Generalized IoU from https://giou.stanford.edu/ The boxes should be in [x0, y0, x1, y1] format Returns a [N, M] pairwise matrix, where
utils/box_ops.py:60
Methodgenerate
r""" Generates sequences for models with a LM head. The method currently supports greedy decoding, beam-search decoding, sampling with temperature, sa
bert/generation_utils.py:101
MethodgetAnnIds
(self, image_ids=[], cat_ids=[], ref_ids=[])
tools/refer.py:173
MethodgetCatIds
(self)
tools/refer.py:207
Methodget_input_embeddings
(self)
bert/modeling_bert.py:654
Methodget_input_ids
(text)
bert/tokenization_utils.py:423
Methodget_output_embeddings
(self)
bert/modeling_bert.py:787
← previousnext →301–400 of 468, ranked by callers