MCPcopy Create free account

hub / github.com/YunwenTechnology/QueryGeneration / functions

Functions82 in github.com/YunwenTechnology/QueryGeneration

↓ 16 callersFunctionget_shape_list
Returns a list of the shape of tensor, preferring static dimensions. Args: tensor: A tf.Tensor object to find the shape of. expected_
train/utils.py:48
↓ 6 callersFunctioncreate_initializer
Creates a `truncated_normal_initializer` with the given range.
train/modeling.py:101
↓ 4 callersFunctionconvert_by_vocab
Converts a sequence of [tokens|ids] using the vocab.
tokenization/tokenization.py:123
↓ 3 callersFunction_attention_projection_and_transpose
:param x_flat: [batch_size*seq_length, width] :return: A fixed up tensor of size [batch_size, num_attention_heads, seq_length, size_per_head]
train/modeling.py:106
↓ 3 callersMethodclose
(self)
dataset/prepare_data.py:99
↓ 3 callersFunctionconvert_to_unicode
Converts `text` to Unicode (if it's not already), assuming utf-8 input.
tokenization/tokenization.py:65
↓ 3 callersFunctionlayer_norm
Run layer normalization on the last dimension of the tensor.
train/utils.py:101
↓ 3 callersMethodtokenize
(self, text)
tokenization/tokenization.py:157
↓ 3 callersFunctionwhitespace_tokenize
Runs basic whitespace cleaning and splitting on a piece of text.
tokenization/tokenization.py:139
↓ 3 callersMethodwrite
(self, x)
dataset/prepare_data.py:96
↓ 2 callersFunction_decode_record
Decodes a record to a TensorFlow example.
train/dataloader.py:8
↓ 2 callersFunction_top_p_sample
Does top-p sampling. if ignore_ids is on, then we will zero out those logits. :param logits: [batch_size, vocab_size] tensor :param ignor
train/modeling.py:312
↓ 2 callersMethodconvert_ids_to_tokens
(self, ids)
tokenization/tokenization.py:168
↓ 2 callersMethodconvert_tokens_to_ids
(self, tokens)
tokenization/tokenization.py:165
↓ 2 callersFunctiondropout
Perform dropout. Args: input_tensor: float Tensor. dropout_prob: Python float. The probability of dropping out a value (NOT of
train/utils.py:115
↓ 2 callersMethodfrom_json_file
Constructs a `NewsConfig` from a json file of parameters.
train/modeling.py:71
↓ 2 callersFunctionreduce_rms
(x)
train/optimization_adafactor.py:231
↓ 2 callersFunctionsample_step
Helper function that samples from grover for a single step :param tokens: [batch_size, n_ctx_b] tokens that we will predict from :param i
train/modeling.py:655
↓ 1 callersMethod_clean_text
Performs invalid character removal and whitespace cleanup on text.
tokenization/tokenization.py:273
↓ 1 callersMethod_do_use_weight_decay
Whether to use L2 weight decay for `param_name`.
train/optimization_adafactor.py:213
↓ 1 callersMethod_get_variable_name
Get the variable name from the tensor name.
train/optimization_adafactor.py:223
↓ 1 callersMethod_is_chinese_char
Checks whether CP is the codepoint of a CJK character.
tokenization/tokenization.py:251
↓ 1 callersFunction_is_control
Checks whether `chars` is a control character.
tokenization/tokenization.py:361
↓ 1 callersFunction_is_punctuation
Checks whether `chars` is a punctuation character.
tokenization/tokenization.py:373
↓ 1 callersFunction_is_whitespace
Checks whether `chars` is a whitespace character.
tokenization/tokenization.py:349
↓ 1 callersMethod_run_split_on_punc
Splits punctuation on a piece of text.
tokenization/tokenization.py:218
↓ 1 callersMethod_run_strip_accents
Strips accents from a piece of text.
tokenization/tokenization.py:207
↓ 1 callersMethod_tokenize_chinese_chars
Adds whitespace around any CJK character.
tokenization/tokenization.py:238
↓ 1 callersFunction_top_k_sample
Does top-k sampling. if ignore_ids is on, then we will zero out those logits. :param logits: [batch_size, vocab_size] tensor :param ignor
train/modeling.py:366
↓ 1 callersMethod_use_factored
(self, shape)
train/optimization_adafactor.py:112
↓ 1 callersMethodapply_gradients
See base class.
train/optimization_adafactor.py:128
↓ 1 callersFunctionarticle_iterator
Iterate through the provided filename + tokenize
dataset/prepare_data.py:131
↓ 1 callersFunctionassert_rank
Raises an exception if the tensor rank is not of the expected rank. Args: tensor: A tf.Tensor to check the rank of. expected_rank: Py
train/utils.py:18
↓ 1 callersFunctionattention_layer
:param x_flat: Tensor input, should be [batch_size*seq_length, dim] :param attention_mask: Attention mask to use of size [seq_length, seq_le
train/modeling.py:131
↓ 1 callersFunctionbuffered_and_sliding_window_article_iterator
We apply a sliding window to fix long sequences, and use a buffer that combines short sequences.
dataset/prepare_data.py:172
↓ 1 callersFunctioncreate_int_feature
(values)
dataset/prepare_data.py:166
↓ 1 callersFunctionembed
reur and position embeddings :param input_ids: int Tensor of shape [batch_size, seq_length]. :param vocab_size: number of words in vocab :
train/modeling.py:243
↓ 1 callersFunctionextract_generated_target
Given some tokens that were generated, extract the target :param output_tokens: [num_tokens] thing that was generated :param encoder: how
scripts/interactive_conditional_samples.py:99
↓ 1 callersMethodfrom_dict
Constructs a `NewsConfig` from a Python dictionary of parameters.
train/modeling.py:63
↓ 1 callersFunctionget_assignment_map_from_checkpoint
Compute the union of the current variables and checkpoint variables.
train/utils.py:143
↓ 1 callersFunctionget_attention_mask
this is a TPU compatible version of tf.matrix_band_part(tf.ones([nd, ns]), -1, ns-nd) where the lower right triangle contains 1s
train/utils.py:132
↓ 1 callersFunctioninitialize_from_context
same signature as sample_step
train/modeling.py:700
↓ 1 callersFunctioninput_fn_builder
Creates an `input_fn` closure to be passed to TPUEstimator.
train/dataloader.py:22
↓ 1 callersMethodlm_loss
:return: stuff
train/modeling.py:513
↓ 1 callersFunctionload_vocab
Loads a vocabulary file into a dictionary.
tokenization/tokenization.py:108
↓ 1 callersFunctionmask_attention_for_ltr
Mask attention so that we're only predicting going forward :param attention_scores: [batch, heads, dst_sequence, src_sequence], where informa
train/modeling.py:87
↓ 1 callersFunctionmodel_fn_builder
Returns `model_fn` closure for TPUEstimator.
train/modeling.py:549
↓ 1 callersFunctionresidual_mlp_layer
:param x: The attention output. It should be [batch_size*seq_length, dim] :param intermediate_size: the hidden projection. By default this is
train/modeling.py:212
↓ 1 callersFunctionsample
V1 version of: sample outputs from a model, and do it all at once :param news_config: Configuration used to construct the model :param in
train/modeling.py:713
↓ 1 callersMethodto_dict
Serializes this instance to a Python dictionary.
train/modeling.py:77
Method__enter__
(self)
dataset/prepare_data.py:120
Method__exit__
(self, *_)
dataset/prepare_data.py:124
Method__init__
(self, vocab_file, do_lower_case=True)
tokenization/tokenization.py:151
Method__init__
Constructs a BasicTokenizer. Args: do_lower_case: Whether to lower case the input.
tokenization/tokenization.py:175
Method__init__
(self, vocab, unk_token="[UNK]", max_input_chars_per_word=200)
tokenization/tokenization.py:290
Method__init__
(self, fn)
dataset/prepare_data.py:65
Method__init__
Constructs NewsConfig. Args: vocab_size: Vocabulary size of `inputs_ids` in `GroverModel`. hidden_size: Size of the layer
train/modeling.py:17
Method__init__
:param config: :param is_training: :param input_ids: Tensor thats of size [batch_size, seq_length] :param cache: Opti
train/modeling.py:402
Method__init__
Constructs a AdaFactorOptimizer.
train/optimization_adafactor.py:89
Method_parameter_scale
Estimate the scale of the parameters from the current values. We include a minimum value of 0.001 to give it a chance to escape 0 if i
train/optimization_adafactor.py:115
Function_save_np
(absolute_fn, array)
train/utils.py:10
Functionbody
for whatever reason this didn't work when I ran it on more than one at once... ugh.
train/modeling.py:738
Functionclassification_convert_examples_to_features
Convert a set of `InputExample`s to a TFRecord file.
train/dataloader.py:78
Functionclassification_input_fn_builder
Creates an `input_fn` closure to be passed to TPUEstimator.
train/dataloader.py:120
Functioncond
(ctx, cache, probs)
train/modeling.py:751
Functionconstruct_scalar_host_call
Construct a host call to log scalars when training on TPU. Args: metric_dict: A dict of the tensors to be logged. model_dir: The loca
train/utils.py:169
Functionconvert_ids_to_tokens
(inv_vocab, ids)
tokenization/tokenization.py:135
Functionconvert_tokens_to_ids
(vocab, tokens)
tokenization/tokenization.py:131
Functioncreate_optimizer
Creates an optimizer training op.
train/optimization_adafactor.py:20
Functiongelu
Gaussian Error Linear Unit. This is a smoother version of the RELU. Original paper: https://arxiv.org/abs/1606.08415 Args: input_t
train/utils.py:85
Functionhost_call_fn
Training host call. Creates scalar summaries for training metrics. This function is executed on the CPU and should not directly reference
train/utils.py:182
Functioninput_fn
The actual input function.
train/dataloader.py:30
Methodlog_probs
(self)
train/modeling.py:509
Functionmain
(_)
train/train_run_query2query_mega.py:52
Functionmetric_fn
(total_loss)
train/modeling.py:615
Functionmodel_fn
The `model_fn` for TPUEstimator.
train/modeling.py:553
Methodpooled_output
Extract pooled output given a token that says where we should look :param clf_token: :return:
train/modeling.py:539
Functionprintable_text
Returns text encoded in a way suitable for print or `tf.logging`.
tokenization/tokenization.py:85
Methodto_json_string
Serializes this instance to a JSON string.
train/modeling.py:82
Methodtokenize
Tokenizes a piece of text.
tokenization/tokenization.py:183
Methodtokenize
Tokenizes a piece of text into its word pieces. This uses a greedy longest-match-first algorithm to perform tokenization using the given voca
tokenization/tokenization.py:295
Functionvalidate_case_matches_checkpoint
Checks whether the casing config is consistent with the checkpoint name.
tokenization/tokenization.py:15