MCPcopy Create free account

hub / github.com/DA-southampton/Read_Bert_Code / functions

Functions740 in github.com/DA-southampton/Read_Bert_Code

↓ 42 callersMethodinit_weights
Initialize and prunes weights if needed.
bert_read_step_to_step/transformers/modeling_utils.py:180
↓ 25 callersMethod_read_tsv
Reads a tab separated value file.
bert_read_step_to_step/processors/utils.py:103
↓ 25 callersMethodfrom_pretrained
r""" Instantiates one of the base model classes of the library from a pre-trained model configuration. The model class to instantiate
bert_read_step_to_step/transformers/modeling_auto.py:67
↓ 21 callersMethod__init__
(self, config)
bert_read_step_to_step/transformers/modeling_bert.py:319
↓ 21 callersMethodload
(module, prefix='')
bert_read_step_to_step/transformers/modeling_utils.py:402
↓ 21 callersMethodupdate
(self, val, n=1)
bert_read_step_to_step/tools/common.py:239
↓ 17 callersMethod__init__
(self, config)
bert_read_step_to_step/transformers/modeling_albert.py:243
↓ 17 callersFunctionprune_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_read_step_to_step/transformers/modeling_utils.py:758
↓ 14 callersMethod_tie_or_clone_weights
Tie or clone module weights depending of weither we are using TorchScript or not
bert_read_step_to_step/transformers/modeling_utils.py:120
↓ 14 callersMethodconvert_tokens_to_ids
Converts a single token, or a sequence of tokens, (str/unicode) in a single integer id (resp. a sequence of ids), using the vocabulary.
bert_read_step_to_step/transformers/tokenization_utils.py:661
↓ 12 callersMethod__init__
(self, config)
convert_tf_to_pytorch/modeling.py:263
↓ 11 callersFunctionsimple_accuracy
(preds, labels)
bert_read_step_to_step/metrics/glue_compute_metrics.py:33
↓ 9 callersMethod__init__
(self, config)
bert_read_step_to_step/transformers/modeling_distilbert.py:198
↓ 9 callersMethodencode_file
(self, path, ordered=False, verbose=False, add_eos=True, add_double_eos=False)
bert_read_step_to_step/transformers/tokenization_transfo_xl.py:176
↓ 8 callersMethod__init__
(self, config)
bert_read_step_to_step/transformers/modeling_xlnet.py:428
↓ 8 callersMethod__init__
(self, config)
bert_read_step_to_step/transformers/modeling_xlm.py:340
↓ 8 callersMethod_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_read_step_to_step/transformers/modeling_utils.py:86
↓ 7 callersMethod__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_read_step_to_step/transformers/modeling_utils.py:443
↓ 7 callersFunctionadd_w_and_b
(ernie_pre, pytroch_pre)
bert_read_step_to_step/convert_ernie_original_pad_checkpoint_to_pytorch.py:108
↓ 7 callersMethodtokenize
Basic Tokenization of a piece of text. Split on "white spaces" only, for sub-word tokenization, see WordPieceTokenizer. Args:
bert_read_step_to_step/transformers/tokenization_bert.py:292
↓ 6 callersMethod__init__
(self, d_model, d_inner, dropout, pre_lnorm=False, layer_norm_epsilon=1e-5)
bert_read_step_to_step/transformers/modeling_transfo_xl.py:197
↓ 6 callersMethod__init__
(self, n_state, config)
bert_read_step_to_step/transformers/modeling_gpt2.py:204
↓ 6 callersMethod__init__
(self, config)
bert_read_step_to_step/transformers/modeling_roberta.py:165
↓ 6 callersMethod_compute_logit
(self, hidden, weight, bias, proj)
bert_read_step_to_step/transformers/modeling_transfo_xl_utilities.py:78
↓ 6 callersMethod_init_weight
(self, weight)
bert_read_step_to_step/transformers/modeling_transfo_xl.py:466
↓ 6 callersMethod_read_txt
Reads a tab separated value file.
bert_read_step_to_step/processors/utils.py:113
↓ 5 callersMethod__init__
(self, params, lr=1e-3, betas=(0.9, 0.999), eps=1e-6, weight_decay=0.0, correct_bias=True)
bert_read_step_to_step/transformers/optimization.py:117
↓ 5 callersMethod__init__
(self, n_state, config)
bert_read_step_to_step/transformers/modeling_openai.py:223
↓ 5 callersMethoddecode
Converts a sequence of ids (integer) in a string, using the tokenizer and vocabulary with options to remove special tokens and clean
bert_read_step_to_step/transformers/tokenization_utils.py:990
↓ 5 callersMethodpositional_embedding
(pos_seq, inv_freq, bsz=None)
bert_read_step_to_step/transformers/modeling_xlnet.py:667
↓ 5 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_read_step_to_step/transformers/modeling_utils.py:783
↓ 4 callersMethod_init_bias
(self, bias)
bert_read_step_to_step/transformers/modeling_transfo_xl.py:472
↓ 4 callersFunctioncached_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_read_step_to_step/transformers/file_utils.py:155
↓ 4 callersMethodcount_file
(self, path, verbose=False, add_eos=False)
bert_read_step_to_step/transformers/tokenization_transfo_xl.py:108
↓ 4 callersMethodencode
Converts a string in a sequence of ids (integer), using the tokenizer and vocabulary. Same as doing ``self.convert_tokens_to_ids(sel
bert_read_step_to_step/transformers/tokenization_utils.py:691
↓ 4 callersMethodfrom_json_file
Constructs a `BertConfig` from a json file of parameters.
bert_read_step_to_step/transformers/configuration_utils.py:183
↓ 4 callersFunctionis_torch_available
()
bert_read_step_to_step/transformers/file_utils.py:75
↓ 4 callersMethodmoses_pipeline
(self, text, lang)
bert_read_step_to_step/transformers/tokenization_xlm.py:590
↓ 4 callersMethodrel_attn_core
Core relative positional attention operations.
bert_read_step_to_step/transformers/modeling_xlnet.py:257
↓ 3 callersMethod__init__
(self, config)
bert_read_step_to_step/transformers/modeling_ctrl.py:269
↓ 3 callersMethod_create_examples
Creates examples for the training and dev sets.
bert_read_step_to_step/processors/glue.py:319
↓ 3 callersMethod_create_examples
Creates examples for the training and dev sets.
bert_read_step_to_step/processors/glue.py:403
↓ 3 callersMethod_create_examples
Creates examples for the training and dev sets.
bert_read_step_to_step/processors/glue.py:440
↓ 3 callersMethod_create_examples
Creates examples for the training and dev sets.
bert_read_step_to_step/processors/glue.py:536
↓ 3 callersMethodget_labels
See base class.
bert_read_step_to_step/processors/glue.py:532
↓ 3 callersFunctionis_tf_available
()
bert_read_step_to_step/transformers/file_utils.py:78
↓ 3 callersFunctionload_and_cache_examples
(args, task, tokenizer, data_type='train')
bert_read_step_to_step/run_classifier.py:274
↓ 3 callersMethodpost_attention
Post-attention processing.
bert_read_step_to_step/transformers/modeling_xlnet.py:299
↓ 3 callersMethodsave_pretrained
Save a model and its configuration file to a directory, so that it can be re-loaded using the `:func:`~transformers.PreTrainedModel.from_
bert_read_step_to_step/transformers/modeling_utils.py:206
↓ 3 callersMethodsplit_heads
(self, x, k=False)
bert_read_step_to_step/transformers/modeling_gpt2.py:172
↓ 3 callersMethodsplit_heads
(self, x, k=False)
bert_read_step_to_step/transformers/modeling_openai.py:196
↓ 3 callersMethodsplit_into_heads
(self, x, batch_size)
bert_read_step_to_step/transformers/modeling_ctrl.py:98
↓ 3 callersMethodtie_weights
Make sure we are sharing the input and output embeddings. Export to TorchScript can't handle parameter sharing so we are cloning them
bert_read_step_to_step/transformers/modeling_ctrl.py:454
↓ 3 callersMethodtranspose_for_scores
(self, x)
bert_read_step_to_step/transformers/modeling_bert.py:196
↓ 3 callersMethodtranspose_for_scores
(self, x)
convert_tf_to_pytorch/modeling.py:176
↓ 3 callersFunctionwhitespace_tokenize
Runs basic whitespace cleaning and splitting on a piece of text.
bert_read_step_to_step/transformers/tokenization_bert.py:100
↓ 2 callersMethod_convert_id_to_token
(self, index)
bert_read_step_to_step/transformers/tokenization_utils.py:980
↓ 2 callersMethod_convert_token_to_id
(self, token)
bert_read_step_to_step/transformers/tokenization_utils.py:688
↓ 2 callersMethod_convert_token_to_id_with_added_voc
(self, token)
bert_read_step_to_step/transformers/tokenization_utils.py:680
↓ 2 callersMethod_create_examples
Creates examples for the training and dev sets.
bert_read_step_to_step/processors/glue.py:169
↓ 2 callersMethod_create_examples
Creates examples for the training and dev sets.
bert_read_step_to_step/processors/glue.py:202
↓ 2 callersMethod_create_examples
Creates examples for the training and dev sets.
bert_read_step_to_step/processors/glue.py:364
↓ 2 callersMethod_create_examples
Creates examples for the training and dev sets.
bert_read_step_to_step/processors/glue.py:473
↓ 2 callersMethod_create_examples
Creates examples for the training and dev sets.
bert_read_step_to_step/processors/glue.py:504
↓ 2 callersMethod_create_examples
Creates examples for the training and dev sets.
bert_read_step_to_step/processors/glue.py:572
↓ 2 callersMethod_create_examples
Creates examples for the training and dev sets.
bert_read_step_to_step/processors/glue.py:604
↓ 2 callersMethod_create_examples
Creates examples for the training and dev sets.
bert_read_step_to_step/processors/glue.py:636
↓ 2 callersMethod_tie_or_clone_data
Tie or clone module weights depending of weither we are using TorchScript or not
bert_read_step_to_step/transformers/modeling_utils.py:136
↓ 2 callersMethod_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_read_step_to_step/transformers/tokenization_utils.py:652
↓ 2 callersFunctionacc_and_f1
(preds, labels)
bert_read_step_to_step/metrics/glue_compute_metrics.py:37
↓ 2 callersMethodadd_symbol
(self, sym)
bert_read_step_to_step/transformers/tokenization_transfo_xl.py:213
↓ 2 callersMethodadd_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_read_step_to_step/transformers/tokenization_utils.py:488
↓ 2 callersMethodbpe
(self, token)
bert_read_step_to_step/transformers/tokenization_openai.py:115
↓ 2 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_read_step_to_step/transformers/tokenization_utils.py:928
↓ 2 callersMethodbuild_vocab
(self)
bert_read_step_to_step/transformers/tokenization_transfo_xl.py:155
↓ 2 callersMethodconvert_ids_to_tokens
Converts a single index or a sequence of indices (integers) in a token " (resp.) a sequence of tokens (str/unicode), using the vocabulary
bert_read_step_to_step/transformers/tokenization_utils.py:958
↓ 2 callersFunctionconvert_tf_checkpoint_to_pytorch
(tf_checkpoint_path, bert_config_file, pytorch_dump_path)
bert_read_step_to_step/convert_bert_original_tf_checkpoint_to_pytorch.py:29
↓ 2 callersMethodconvert_to_tensor
(self, symbols)
bert_read_step_to_step/transformers/tokenization_transfo_xl.py:245
↓ 2 callersMethodconvert_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_read_step_to_step/transformers/tokenization_utils.py:983
↓ 2 callersFunctionconvert_xlnet_checkpoint_to_pytorch
(tf_checkpoint_path, bert_config_file, pytorch_dump_folder_path, finetuning_task=None)
bert_read_step_to_step/convert_xlnet_original_tf_checkpoint_to_pytorch.py:46
↓ 2 callersMethodencode_plus
Returns a dictionary containing the encoded sequence or sequence pair and additional informations: the mask for sequence classificati
bert_read_step_to_step/transformers/tokenization_utils.py:739
↓ 2 callersFunctionevaluate
(args, model, tokenizer, prefix="")
bert_read_step_to_step/run_classifier.py:164
↓ 2 callersMethodget_batch
(self, i, bptt=None)
bert_read_step_to_step/transformers/tokenization_transfo_xl.py:295
↓ 2 callersFunctionget_pairs
Return set of symbol pairs in a word. word is represented as tuple of symbols (symbols being variable-length strings)
bert_read_step_to_step/transformers/tokenization_openai.py:50
↓ 2 callersFunctionget_pairs
Return set of symbol pairs in a word. Word is represented as tuple of symbols (symbols being variable-length strings).
bert_read_step_to_step/transformers/tokenization_gpt2.py:91
↓ 2 callersFunctionget_pairs
Return set of symbol pairs in a word. Word is represented as tuple of symbols (symbols being variable-length strings).
bert_read_step_to_step/transformers/tokenization_ctrl.py:49
↓ 2 callersFunctionget_pairs
Return set of symbol pairs in a word. word is represented as tuple of symbols (symbols being variable-length strings)
bert_read_step_to_step/transformers/tokenization_xlm.py:415
↓ 2 callersMethodinit_mems
(self, data)
bert_read_step_to_step/transformers/modeling_transfo_xl.py:657
↓ 2 callersMethodprune_heads
(self, heads)
bert_read_step_to_step/transformers/modeling_xlm.py:116
↓ 2 callersMethodprune_heads
(self, heads)
bert_read_step_to_step/transformers/modeling_gpt2.py:121
↓ 2 callersFunctionseed_everything
设置整个开发环境的seed :param seed: :param device: :return:
bert_read_step_to_step/tools/common.py:43
↓ 2 callersFunctionsplit_s3_path
Split a full s3 path into the bucket name and path.
bert_read_step_to_step/transformers/file_utils.py:188
↓ 2 callersMethodstep
Performs a single optimization step. Arguments: closure (callable, optional): A closure that reevaluates the model
bert_read_step_to_step/transformers/optimization.py:130
↓ 2 callersMethodstream_iterator
(self, sent_stream)
bert_read_step_to_step/transformers/tokenization_transfo_xl.py:353
↓ 2 callersMethodto_json_string
Serializes this instance to a JSON string.
bert_read_step_to_step/transformers/configuration_utils.py:200
↓ 2 callersMethodto_json_string
Serializes this instance to a JSON string.
bert_read_step_to_step/processors/utils.py:49
↓ 1 callersMethod__init__
(self, *args, **kwargs)
bert_read_step_to_step/transformers/tokenization_transfo_xl.py:487
↓ 1 callersMethod__init__
Reference : https://github.com/tensorflow/tensorflow/blob/r1.10/tensorflow/python/ops/candidate_sampling_ops.py `P(class) = (log(
bert_read_step_to_step/transformers/modeling_transfo_xl_utilities.py:261
↓ 1 callersMethod_attn
(self, q, k, v, attention_mask=None, head_mask=None)
bert_read_step_to_step/transformers/modeling_gpt2.py:143
↓ 1 callersMethod_attn
(self, q, k, v, attention_mask=None, head_mask=None)
bert_read_step_to_step/transformers/modeling_openai.py:166
next →1–100 of 740, ranked by callers