0cfe82c6beb9a28a5ff7da81b86fa0e93c388f14,tasks/save_reload_model.py,,,#,10
Before Change
// simple TCN model.
max_len = 100
max_features = 50
i = Input(shape=(max_len,))
x = Embedding(max_features, 16)(i)
x = TCN(nb_filters=12,
dropout_rate=0.5, // with dropout here.
kernel_size=6,
dilations=[1, 2, 4])(x)
x = Dropout(0.5)(x) // and dropout here.
x = Dense(1, activation="sigmoid")(x)
model = Model(inputs=[i], outputs=[x])
if os.path.exists("tcn.npz"):
// Load checkpoint if file exists.
w = np.load("tcn.npz", allow_pickle=True)["w"]
After Change
// Make inference.
out2 = reloaded_model.predict(inputs)[0, 0]
print("*" * 80)
print("Inference after loading:", out2)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 10
Instances
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:
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: 565960370df285169f4a2b2a7368e3d9f07e6617
Time: 2021-03-09
Author: premy.enseirb@gmail.com
File Name: tasks/non_causal.py
Class Name:
Method Name: