bf78b94b2907fbcd5740e35a7b21ea2c434e380d,examples/text_generation/tutorial_generate_text.py,,main_restore_embedding_layer,#,132

Before Change



    del all_var, data, count

    load_params = tl.files.load_npz(name=model_file_name + ".npz")

    x = tf.placeholder(tf.int32, shape=[batch_size])

    emb_net = tl.layers.EmbeddingInputlayer(x, vocabulary_size, embedding_size, name="emb")

    // sess.run(tf.global_variables_initializer())
    tl.layers.initialize_global_variables(sess)

    tl.files.assign_params(sess, [load_params[0]], emb_net)

    emb_net.print_params()
    emb_net.print_layers()

After Change


    x = tf.placeholder(tf.int32, shape=[batch_size])

    net_in = tl.layers.Input([batch_size], dtype=tf.int32)
    emb_net = tl.layers.Embedding(vocabulary_size, embedding_size, name="emb")(net_in)

    model = tl.models.Model(inputs=net_in, outputs=emb_net, name="model")

    sess.run(tf.global_variables_initializer())
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: tensorlayer/tensorlayer
Commit Name: bf78b94b2907fbcd5740e35a7b21ea2c434e380d
Time: 2019-02-27
Author: jingqing.zhang15@imperial.ac.uk
File Name: examples/text_generation/tutorial_generate_text.py
Class Name:
Method Name: main_restore_embedding_layer


Project Name: philipperemy/keras-tcn
Commit Name: 565960370df285169f4a2b2a7368e3d9f07e6617
Time: 2021-03-09
Author: premy.enseirb@gmail.com
File Name: tasks/imdb_tcn.py
Class Name:
Method Name:


Project Name: philipperemy/keras-tcn
Commit Name: 0cfe82c6beb9a28a5ff7da81b86fa0e93c388f14
Time: 2019-11-20
Author: premy@cogent.co.jp
File Name: tasks/save_reload_model.py
Class Name:
Method Name: