MCPcopy Create free account

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

Functions740 in github.com/DA-southampton/Read_Bert_Code

↓ 1 callersMethod_build_from_file
(self, vocab_file)
bert_read_step_to_step/transformers/tokenization_transfo_xl.py:133
↓ 1 callersMethod_clean_text
Performs invalid character removal and whitespace cleanup on text.
bert_read_step_to_step/transformers/tokenization_bert.py:391
↓ 1 callersMethod_from_pretrained
(cls, pretrained_model_name_or_path, *init_inputs, **kwargs)
bert_read_step_to_step/transformers/tokenization_utils.py:286
↓ 1 callersMethod_init_weights
Initialize the weights.
bert_read_step_to_step/transformers/modeling_xlm.py:230
↓ 1 callersMethod_is_chinese_char
Checks whether CP is the codepoint of a CJK character.
bert_read_step_to_step/transformers/tokenization_bert.py:369
↓ 1 callersFunction_is_control
Checks whether `chars` is a control character.
bert_read_step_to_step/transformers/tokenization_bert.py:477
↓ 1 callersFunction_is_punctuation
Checks whether `chars` is a punctuation character.
bert_read_step_to_step/transformers/tokenization_bert.py:489
↓ 1 callersFunction_is_whitespace
Checks whether `chars` is a whitespace character.
bert_read_step_to_step/transformers/tokenization_bert.py:465
↓ 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_read_step_to_step/transformers/modeling_xlm.py:414
↓ 1 callersMethod_rel_shift
(self, x)
bert_read_step_to_step/transformers/modeling_transfo_xl.py:266
↓ 1 callersMethod_resize_token_embeddings
(self, new_num_tokens)
bert_read_step_to_step/transformers/modeling_xlm.py:410
↓ 1 callersMethod_run_split_on_punc
Splits punctuation on a piece of text.
bert_read_step_to_step/transformers/tokenization_bert.py:334
↓ 1 callersMethod_run_strip_accents
Strips accents from a piece of text.
bert_read_step_to_step/transformers/tokenization_bert.py:323
↓ 1 callersMethod_tokenize_chinese_chars
Adds whitespace around any CJK character.
bert_read_step_to_step/transformers/tokenization_bert.py:356
↓ 1 callersMethod_update_mems
(self, hids, mems, qlen, mlen)
bert_read_step_to_step/transformers/modeling_transfo_xl.py:670
↓ 1 callersFunctionadd_one_encoder_layer
(layer_number)
bert_read_step_to_step/convert_ernie_original_pad_checkpoint_to_pytorch.py:112
↓ 1 callersMethodadd_special
(self, sym)
bert_read_step_to_step/transformers/tokenization_transfo_xl.py:207
↓ 1 callersFunctionangle_defn
(pos, i, d_model_size)
bert_read_step_to_step/transformers/modeling_ctrl.py:42
↓ 1 callersMethodbpe
(self, token)
bert_read_step_to_step/transformers/tokenization_gpt2.py:139
↓ 1 callersMethodbpe
(self, token)
bert_read_step_to_step/transformers/tokenization_ctrl.py:92
↓ 1 callersMethodbpe
(self, token)
bert_read_step_to_step/transformers/tokenization_xlm.py:615
↓ 1 callersFunctionbuild_tf_to_pytorch_map
A map of modules from TF to PyTorch. This time I use a map to keep the PyTorch model as identical to the original PyTorch model as possible.
bert_read_step_to_step/transformers/modeling_transfo_xl.py:48
↓ 1 callersFunctionbuild_tf_xlnet_to_pytorch_map
A map of modules from TF to PyTorch. I use a map to keep the PyTorch model as identical to the original PyTorch model as possible.
bert_read_step_to_step/transformers/modeling_xlnet.py:45
↓ 1 callersFunctionbuild_weight_map
()
bert_read_step_to_step/convert_ernie_original_pad_checkpoint_to_pytorch.py:99
↓ 1 callersFunctionbytes_to_unicode
Returns list of utf-8 byte and a mapping to unicode strings. We specifically avoids mapping to whitespace/control characters the bpe code bar
bert_read_step_to_step/transformers/tokenization_gpt2.py:68
↓ 1 callersMethodcache_mem
cache hidden states into memory.
bert_read_step_to_step/transformers/modeling_xlnet.py:654
↓ 1 callersMethodclean_up_tokenization
Clean up a list of simple English tokenization artifacts like spaces before punctuations and abreviated forms.
bert_read_step_to_step/transformers/tokenization_utils.py:1062
↓ 1 callersFunctioncompute_metrics
(task_name, preds, labels)
bert_read_step_to_step/metrics/glue_compute_metrics.py:57
↓ 1 callersFunctionconvert
()
convert_tf_to_pytorch/convert_tf_checkpoint_to_pytorch.py:51
↓ 1 callersFunctionconvert_tf_checkpoint_to_pytorch
(tf_checkpoint_path, bert_config_file, pytorch_dump_path)
bert_read_step_to_step/convert_albert_original_tf_checkpoint_to_pytorch.py:29
↓ 1 callersMethodcreate_mask
Creates causal attention mask. Float mask where 1.0 indicates masked, 0.0 indicates not-masked. Args: qlen: TODO Lysandr
bert_read_step_to_step/transformers/modeling_xlnet.py:624
↓ 1 callersFunctioncreate_model
(args, pyreader_name, ernie_config, is_prediction=False)
bert_read_step_to_step/convert_ernie_original_pad_checkpoint_to_pytorch.py:21
↓ 1 callersFunctioncreate_sinusoidal_embeddings
(n_pos, dim, out)
bert_read_step_to_step/transformers/modeling_distilbert.py:52
↓ 1 callersFunctioncreate_sinusoidal_embeddings
(n_pos, dim, out)
bert_read_step_to_step/transformers/modeling_xlm.py:50
↓ 1 callersMethodcreate_token_type_ids_from_sequences
(self, token_ids_0, token_ids_1=None)
bert_read_step_to_step/transformers/tokenization_utils.py:922
↓ 1 callersFunctionextract_weights
(args)
bert_read_step_to_step/convert_ernie_original_pad_checkpoint_to_pytorch.py:149
↓ 1 callersMethodforward
(self, input_ids, attention_mask=None, token_type_ids=None, position_ids=None, head_mask=None)
bert_read_step_to_step/transformers/modeling_roberta.py:171
↓ 1 callersMethodfrom_dict
Constructs a `Config` from a Python dictionary of parameters.
bert_read_step_to_step/transformers/configuration_utils.py:175
↓ 1 callersMethodfrom_dict
Constructs a `BertConfig` from a Python dictionary of parameters.
convert_tf_to_pytorch/modeling.py:89
↓ 1 callersMethodfrom_json_file
Constructs a `BertConfig` from a json file of parameters.
convert_tf_to_pytorch/modeling.py:97
↓ 1 callersFunctiongelu
(x)
bert_read_step_to_step/transformers/modeling_distilbert.py:49
↓ 1 callersFunctiongelu
GELU activation https://arxiv.org/abs/1606.08415 https://github.com/huggingface/pytorch-openai-transformer-lm/blob/master/model_pytorch.p
bert_read_step_to_step/transformers/modeling_xlm.py:61
↓ 1 callersMethodget_dev_examples
See base class.
bert_read_step_to_step/processors/glue.py:527
↓ 1 callersMethodget_fixlen_iter
(self, start=0)
bert_read_step_to_step/transformers/tokenization_transfo_xl.py:310
↓ 1 callersFunctionget_from_cache
Given a URL, look for the corresponding dataset in the local cache. If it's not there, download it. Then return the path to the cached file.
bert_read_step_to_step/transformers/file_utils.py:249
↓ 1 callersFunctionget_masks
Generate hidden states mask, and optionally an attention mask.
bert_read_step_to_step/transformers/modeling_xlm.py:72
↓ 1 callersMethodget_sent_stream
(self)
bert_read_step_to_step/transformers/tokenization_transfo_xl.py:344
↓ 1 callersMethodget_sent_stream
(self, path)
bert_read_step_to_step/transformers/tokenization_transfo_xl.py:424
↓ 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_read_step_to_step/transformers/tokenization_utils.py:941
↓ 1 callersMethodget_test_examples
See base class.
bert_read_step_to_step/processors/glue.py:259
↓ 1 callersMethodget_train_examples
See base class.
bert_read_step_to_step/processors/glue.py:522
↓ 1 callersFunctionhttp_get
(url, temp_file, proxies=None)
bert_read_step_to_step/transformers/file_utils.py:237
↓ 1 callersFunctioninit_logger
Example: >>> init_logger(log_file) >>> logger.info("abc'")
bert_read_step_to_step/tools/common.py:20
↓ 1 callersMethodinit_weights
(module)
convert_tf_to_pytorch/modeling.py:387
↓ 1 callersMethodinit_weights
(module)
convert_tf_to_pytorch/modeling.py:437
↓ 1 callersMethodja_tokenize
(self, text)
bert_read_step_to_step/transformers/tokenization_xlm.py:596
↓ 1 callersFunctionload_tf_weights_in_albert
Load tf checkpoints in a pytorch model.
bert_read_step_to_step/transformers/modeling_albert.py:47
↓ 1 callersFunctionload_tf_weights_in_bert
Load tf checkpoints in a pytorch model.
bert_read_step_to_step/transformers/modeling_bert.py:55
↓ 1 callersFunctionload_tf_weights_in_xlnet
Load tf checkpoints in a pytorch model
bert_read_step_to_step/transformers/modeling_xlnet.py:115
↓ 1 callersFunctionload_vocab
Loads a vocabulary file into a dictionary.
bert_read_step_to_step/transformers/tokenization_bert.py:89
↓ 1 callersMethodlog_prob
r""" Computes log probabilities for all :math:`n\_classes` From: https://github.com/pytorch/pytorch/blob/master/torch/nn/modules/adaptive.py
bert_read_step_to_step/transformers/modeling_transfo_xl_utilities.py:198
↓ 1 callersFunctionlowercase_and_remove_accent
Lowercase and strips accents from a piece of text based on https://github.com/facebookresearch/XLM/blob/master/tools/lowercase_and_remove_acc
bert_read_step_to_step/transformers/tokenization_xlm.py:428
↓ 1 callersFunctionmain
()
bert_read_step_to_step/run_classifier.py:332
↓ 1 callersFunctionmain
()
bert_read_step_to_step/transformers/__main__.py:2
↓ 1 callersMethodmerge_heads
(self, x)
bert_read_step_to_step/transformers/modeling_gpt2.py:167
↓ 1 callersMethodmerge_heads
(self, x)
bert_read_step_to_step/transformers/modeling_openai.py:191
↓ 1 callersMethodmoses_punct_norm
(self, text, lang)
bert_read_step_to_step/transformers/tokenization_xlm.py:574
↓ 1 callersMethodmoses_tokenize
(self, text, lang)
bert_read_step_to_step/transformers/tokenization_xlm.py:582
↓ 1 callersMethodnum_added_tokens
Returns the number of added tokens when encoding a sequence with special tokens. Note: This encodes inputs and checks th
bert_read_step_to_step/transformers/tokenization_utils.py:528
↓ 1 callersFunctionpearson_and_spearman
(preds, labels)
bert_read_step_to_step/metrics/glue_compute_metrics.py:47
↓ 1 callersFunctionpoint_wise_feed_forward_network
(d_model_size, dff)
bert_read_step_to_step/transformers/modeling_ctrl.py:131
↓ 1 callersFunctionpositional_encoding
(position, d_model_size, dtype)
bert_read_step_to_step/transformers/modeling_ctrl.py:46
↓ 1 callersFunctionprepare_device
setup GPU device if available, move model into configured device # 如果n_gpu_use为数字,则使用range生成list # 如果输入的是一个list,则默认使用list[0]作为controll
bert_read_step_to_step/tools/common.py:61
↓ 1 callersMethodprepare_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, tr
bert_read_step_to_step/transformers/tokenization_utils.py:797
↓ 1 callersMethodpreprocess_text
(self, inputs)
bert_read_step_to_step/transformers/tokenization_xlnet.py:111
↓ 1 callersMethodprune_heads
(self, heads)
bert_read_step_to_step/transformers/modeling_distilbert.py:118
↓ 1 callersMethodprune_heads
Prunes heads of the base model. Arguments: heads_to_prune: dict with keys being selected layer indices (`int`) and asso
bert_read_step_to_step/transformers/modeling_utils.py:189
↓ 1 callersMethodprune_heads
(self, heads)
bert_read_step_to_step/transformers/modeling_bert.py:259
↓ 1 callersMethodprune_heads
(self, heads)
bert_read_step_to_step/transformers/modeling_albert.py:186
↓ 1 callersMethodprune_heads
(self, heads)
bert_read_step_to_step/transformers/modeling_openai.py:147
↓ 1 callersMethodrel_shift_bnij
(x, klen=-1)
bert_read_step_to_step/transformers/modeling_xlnet.py:243
↓ 1 callersMethodrelative_positional_encoding
create relative positional encoding.
bert_read_step_to_step/transformers/modeling_xlnet.py:677
↓ 1 callersFunctionremove_non_printing_char
Port of https://github.com/moses-smt/mosesdecoder/blob/master/scripts/tokenizer/remove-non-printing-char.perl
bert_read_step_to_step/transformers/tokenization_xlm.py:488
↓ 1 callersFunctionreplace_unicode_punct
Port of https://github.com/moses-smt/mosesdecoder/blob/master/scripts/tokenizer/replace-unicode-punctuation.perl
bert_read_step_to_step/transformers/tokenization_xlm.py:445
↓ 1 callersMethodreset
(self)
bert_read_step_to_step/tools/common.py:233
↓ 1 callersMethodreset_length
(self, tgt_len, ext_len, mem_len)
bert_read_step_to_step/transformers/modeling_transfo_xl.py:648
↓ 1 callersFunctionromanian_preprocessing
Sennrich's WMT16 scripts for Romanian preprocessing, used by model `xlm-mlm-enro-1024`
bert_read_step_to_step/transformers/tokenization_xlm.py:501
↓ 1 callersFunctions3_etag
Check ETag on S3 object.
bert_read_step_to_step/transformers/file_utils.py:221
↓ 1 callersFunctions3_get
Pull a file directly from S3.
bert_read_step_to_step/transformers/file_utils.py:230
↓ 1 callersMethodsample
labels: [b1, b2] Return true_log_probs: [b1, b2] samp_log_probs: [n_sample] neg_samples: [n_s
bert_read_step_to_step/transformers/modeling_transfo_xl_utilities.py:280
↓ 1 callersFunctionsample_logits
embedding: an nn.Embedding layer bias: [n_vocab] labels: [b1, b2] inputs: [b1, b2, n_emb] sampler: you may us
bert_read_step_to_step/transformers/modeling_transfo_xl_utilities.py:301
↓ 1 callersFunctionsave_model
(state_dict, dump_path)
bert_read_step_to_step/convert_ernie_original_pad_checkpoint_to_pytorch.py:183
↓ 1 callersMethodsave_vocabulary
Save the tokenizer vocabulary and merge files to a directory.
bert_read_step_to_step/transformers/tokenization_xlm.py:812
↓ 1 callersMethodsave_vocabulary
Save the tokenizer vocabulary to a directory. This method does *NOT* save added tokens and special token mappings. Please us
bert_read_step_to_step/transformers/tokenization_utils.py:469
↓ 1 callersFunctionscaled_dot_product_attention
(q, k, v, mask, attention_mask=None, head_mask=None)
bert_read_step_to_step/transformers/modeling_ctrl.py:58
↓ 1 callersFunctiontext_standardize
fixes some issues the spacy tokenizer had on books corpus also does some whitespace standardization
bert_read_step_to_step/transformers/tokenization_openai.py:62
↓ 1 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 ins
bert_read_step_to_step/transformers/modeling_distilbert.py:518
↓ 1 callersMethodtie_weights
Make sure we are sharing the embeddings
bert_read_step_to_step/transformers/modeling_xlnet.py:926
↓ 1 callersMethodtie_weights
Make sure we are sharing the embeddings
bert_read_step_to_step/transformers/modeling_xlm.py:623
↓ 1 callersMethodtie_weights
Run this to be sure output and input (adaptive) softmax weights are tied
bert_read_step_to_step/transformers/modeling_transfo_xl.py:831
← previousnext →101–200 of 740, ranked by callers