MCPcopy Create free account

hub / github.com/chiphuyen/tf-oreilly / functions

Functions36 in github.com/chiphuyen/tf-oreilly

↓ 3 callersFunctionprocess_data
(vocab_size, batch_size, skip_window)
process_data.py:86
↓ 2 callersFunction_bytes_feature
(value)
02_tfrecord_example.py:18
↓ 2 callersFunctionbuild_vocab
Build vocabulary of VOCAB_SIZE most frequent words
process_data.py:46
↓ 2 callersFunctiondownload
Download the dataset text8 if it's not already downloaded
process_data.py:22
↓ 2 callersFunctionread_data
Read data into a list of tokens There should be 17,005,207 tokens
process_data.py:37
↓ 1 callersMethod_create_embedding
Step 2: define weights. In word2vec, it's actually the weights that we care about
02_word2vec_visualize.py:45
↓ 1 callersMethod_create_loss
Step 3 + 4: define the model + the loss function
02_word2vec_visualize.py:54
↓ 1 callersMethod_create_optimizer
Step 5: define optimizer
02_word2vec_visualize.py:75
↓ 1 callersMethod_create_placeholders
Step 1: define the placeholders for input and output
02_word2vec_visualize.py:39
↓ 1 callersMethod_create_summaries
(self)
02_word2vec_visualize.py:81
↓ 1 callersFunction_int64_feature
(value)
02_tfrecord_example.py:15
↓ 1 callersFunctionbatch_generator
filenames is the list of files you want to read from. In this case, it contains only heart.csv
02_csv_reader.py:18
↓ 1 callersMethodbuild_graph
Build the graph for our model
02_word2vec_visualize.py:89
↓ 1 callersFunctionconvert_words_to_index
Replace each word in the dataset with its index in the dictionary
process_data.py:62
↓ 1 callersFunctiongenerate_batches
(data_batch, label_batch)
02_csv_reader.py:63
↓ 1 callersFunctiongenerate_sample
Form training pairs according to the skip-gram model.
process_data.py:66
↓ 1 callersFunctionget_batch
Group a numerical stream into batches and yield them as Numpy arrays.
process_data.py:77
↓ 1 callersFunctionget_image_binary
You can read in the image using tensorflow too, but it's a drag since you have to create graphs. It's much easier using Pillow and NumPy
02_tfrecord_example.py:21
↓ 1 callersFunctionmain
()
02_word2vec_no_frills.py:71
↓ 1 callersFunctionmain
()
02_tfrecord_example.py:83
↓ 1 callersFunctionmain
()
02_word2vec_visualize.py:148
↓ 1 callersFunctionmain
()
02_csv_reader.py:73
↓ 1 callersFunctionmain
()
02_word2vec_starter.py:99
↓ 1 callersFunctionread_from_tfrecord
(filenames)
02_tfrecord_example.py:48
↓ 1 callersFunctionread_tfrecord
(tfrecord_file)
02_tfrecord_example.py:69
↓ 1 callersFunctiontrain_model
(model, batch_gen, num_train_steps, weights_fld)
02_word2vec_visualize.py:97
↓ 1 callersFunctionword2vec
Build the graph for word2vec model and train it
02_word2vec_no_frills.py:25
↓ 1 callersFunctionword2vec
Build the graph for word2vec model and train it
02_word2vec_starter.py:23
↓ 1 callersFunctionwrite_tfrecord
(label, image_file, tfrecord_file)
02_tfrecord_example.py:44
↓ 1 callersFunctionwrite_to_tfrecord
This example is to write a sample to TFRecord file. If you want to write more samples, just use a loop.
02_tfrecord_example.py:30
Method__init__
(self, vocab_size, embed_size, batch_size, num_sampled, learning_rate)
02_word2vec_visualize.py:31
Functionf1
()
utils.py:7
Functionf2
()
utils.py:8
Functionget_index_vocab
(vocab_size)
process_data.py:95
Functionhuber_loss
(labels, predictions, delta=1.0)
utils.py:5
Functionmake_dir
Create a directory if there isn't one already.
utils.py:11