MCPcopy Create free account

hub / github.com/chao-ji/tf-word2vec / functions

Functions52 in github.com/chao-ji/tf-word2vec

↓ 2 callersMethod_get_inputs_syn0
Builds the activations of hidden layer given input words embeddings `syn0` and input word indices. Args: syn0: float tensor of shape [
word2vec.py:211
↓ 2 callersMethod_get_inputs_syn0
Builds the activations of hidden layer given input words embeddings `syn0` and input word indices. Args: inputs: int tensor of shape [
tf2.x/model.py:176
↓ 1 callersMethod_build_binary_tree
Builds a Huffman tree for hierarchical softmax. Has the side effect of setting `max_depth`. Args: unigram_counts: list of int, holding
dataset.py:121
↓ 1 callersMethod_build_binary_tree
Builds a Huffman tree for hierarchical softmax. Has the side effect of setting `max_depth`. Args: unigram_counts: list of int, holding
tf2.x/dataset.py:147
↓ 1 callersMethod_build_loss
Builds the graph that leads from data tensors (`inputs`, `labels`) to loss. Has the side effect of setting attribute `syn0`. Args: inpu
word2vec.py:46
↓ 1 callersMethod_build_raw_vocab
Builds raw vocabulary. Args: filenames: list of strings, holding names of text files. Returns: raw_vocab: a list of 2-tuples ho
dataset.py:71
↓ 1 callersMethod_build_raw_vocab
Builds raw vocabulary by iterate through the corpus once and count the unique words. Args: filenames: list of strings, holding names o
tf2.x/dataset.py:45
↓ 1 callersMethod_create_embeddings
Creates initial word embedding variables. Args: vocab_size: int scalar, num of words in vocabulary. scope: string scalar, scope name.
word2vec.py:102
↓ 1 callersMethod_hierarchical_softmax_loss
Builds the loss for hierarchical softmax. Args: inputs: int tensor of shape [batch_size] (skip_gram) or [batch_size, 2*window_size
word2vec.py:176
↓ 1 callersMethod_hierarchical_softmax_loss
Builds the loss for hierarchical softmax. Args: inputs: int tensor of shape [batch_size] (skip_gram) or [batch_size, 2*window_size
tf2.x/model.py:141
↓ 1 callersMethod_negative_sampling_loss
Builds the loss for negative sampling. Args: unigram_counts: list of int, holding word counts. Index of each entry is the same as t
word2vec.py:127
↓ 1 callersMethod_negative_sampling_loss
Builds the loss for negative sampling. Args: inputs: int tensor of shape [batch_size] (skip_gram) or [batch_size, 2*window_size+1]
tf2.x/model.py:90
↓ 1 callersMethod_prepare_inputs_labels
Set shape of `tensor` according to architecture and training algorithm, and split `tensor` into `inputs` and `labels`. Args: tensor: ra
dataset.py:166
↓ 1 callersMethodbuild_dataset
Generates tensor dict mapping from tensor names to tensors. Args: filenames: list of strings, holding names of text files. Retur
tf2.x/dataset.py:219
↓ 1 callersMethodbuild_vocab
Builds vocabulary. Has the side effect of setting the following attributes: - table_words: list of string, holding the list of vocabulary
dataset.py:91
↓ 1 callersMethodbuild_vocab
Builds the vocabulary. Has the side effect of setting the following attributes: for each word `word` we have vocab[word] = index ta
tf2.x/dataset.py:71
↓ 1 callersMethodencode
Split raw text string into tokens (space-separated) and tranlate to token ids. Args: string: string scalar, the raw text string to be
tf2.x/dataset.py:102
↓ 1 callersFunctiongenerate_instances
Generates matrices holding word indices to be passed to Word2Vec models for each sentence. The shape and contents of output matrices depends on the
dataset.py:314
↓ 1 callersFunctiongenerate_instances
Generates matrices holding word indices to be passed to Word2Vec models for each sentence. The shape and contents of output matrices depends on the
tf2.x/dataset.py:336
↓ 1 callersMethodget_tensor_dict
Generates tensor dict mapping from tensor names to tensors. Args: filenames: list of strings, holding names of text files. Retur
dataset.py:195
↓ 1 callersFunctionget_word_indices
Converts a sentence into a list of word indices. Args: sent: a scalar string tensor, a sentence where words are space-delimited. table_word
dataset.py:279
↓ 1 callersMethodmost_similar
Finds the top-k words with smallest cosine distances w.r.t `word`. Args: word: string scalar, the query word. k: int scalar, num of w
tf2.x/word_vectors.py:29
↓ 1 callersFunctionsubsample
Filters out-of-vocabulary words and then applies subsampling on words in a sentence. Words with high frequencies have lower keep probs. Args:
dataset.py:295
↓ 1 callersFunctionsubsample
Filters out-of-vocabulary words and then applies subsampling on words in a sentence. Words with high frequencies have lower keep probs. Args:
tf2.x/dataset.py:317
↓ 1 callersMethodtrain
Adds training related ops to the graph. Args: dataset: a `Word2VecDataset` instance. filenames: a list of strings, holding names of t
word2vec.py:73
↓ 1 callersFunctiontrain_step
(inputs, labels, progress)
tf2.x/run_training.py:104
Method__contains__
(self, word)
word2vec.py:253
Method__contains__
(self, word)
tf2.x/word_vectors.py:23
Method__getitem__
(self, word)
word2vec.py:256
Method__getitem__
(self, word)
tf2.x/word_vectors.py:26
Method__init__
Constructor. Args: arch: string scalar, architecture ('skip_gram' or 'cbow'). algm: string scalar, training algorithm ('negative_samp
word2vec.py:11
Method__init__
Constructor. Args: syn0_final: numpy array of shape [vocab_size, embed_size], final word embeddings. vocab_words: a list of s
word2vec.py:241
Method__init__
Constructor. Args: arch: string scalar, architecture ('skip_gram' or 'cbow'). algm: string scalar: training algorithm ('negative_samp
dataset.py:17
Method__init__
Constructor. Args: syn0_final: numpy array of shape [vocab_size, embed_size], final word embeddings. vocab: a list of strings
tf2.x/word_vectors.py:11
Method__init__
Constructor. Args: max_vocab_size: int scalar, maximum vocabulary size. If > 0, only the top `max_vocab_size` most frequent words
tf2.x/dataset.py:18
Method__init__
Constructor. Args: epochs: int scalar, num times the dataset is iterated. batch_size: int scalar, the returned tensors in `get_tensor
tf2.x/dataset.py:122
Method__init__
Constructor. Args: unigram_counts: a list of ints, the counts of word tokens in the corpus. arch: string scalar, architecture ('skip
tf2.x/model.py:11
Methodcall
Runs the forward pass to compute loss. Args: inputs: int tensor of shape [batch_size] (skip_gram) or [batch_size, 2*window_size+1]
tf2.x/model.py:72
Methodgenerator_fn
()
tf2.x/dataset.py:255
Functionget_train_step_signature
Get the training step signatures for `inputs`, `labels` and `progress` tensor. Args: arch: string scalar, architecture ('skip_gram' or 'cbow
tf2.x/utils.py:6
Methoditerator_initializer
(self)
dataset.py:60
Functionmain
(_)
run_training.py:54
Functionmain
(_)
tf2.x/run_training.py:58
Methodmost_similar
Finds the top-k words with smallest cosine distances w.r.t `word`. Args: word: string scalar, the query word. k: int scalar, num of w
word2vec.py:259
Functionper_target_fn
(index, init_array)
dataset.py:354
Functionper_target_fn
Generate inputs and labels for each target word. `index` is the index of the target word in `indices`.
tf2.x/dataset.py:378
Methodprepare_inputs_labels
(tensor, progress)
tf2.x/dataset.py:286
Methodsyn0
(self)
word2vec.py:43
Methodtable_words
(self)
dataset.py:64
Methodtable_words
(self)
tf2.x/dataset.py:42
Methodunigram_counts
(self)
dataset.py:68
Methodunigram_counts
(self)
tf2.x/dataset.py:38