5307ae3f7d1c4b6bd2285f946db82d944f3844db,examples/text_classification/tutorial_imdb_fasttext.py,,train_test_and_save_model,#,123
Before Change
)
print("Test accuracy: %.5f" % test_accuracy)
classifier.save(sess, MODEL_FILE_PATH)
if __name__ == "__main__":
train_test_and_save_model()
After Change
for epoch in range(N_EPOCH):
start_time = time.time()
print("Epoch %d/%d" % (epoch + 1, N_EPOCH))
train_accuracy = list()
for X_batch, y_batch in tl.iterate.minibatches(X_train, y_train, batch_size=BATCH_SIZE, shuffle=True):
accuracy, _ = sess.run(
[classifier.accuracy, classifier.train_op], feed_dict={
classifier.inputs: tl.prepro.pad_sequences(X_batch),
classifier.labels: y_batch,
}
)
train_accuracy.append(accuracy)
if len(train_accuracy) % N_STEPS_TO_PRINT == 0:
print("\t[%d/%d][%d]accuracy " % (epoch + 1, N_EPOCH, len(train_accuracy)),
np.mean(train_accuracy[-N_STEPS_TO_PRINT:]))
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances
Project Name: tensorlayer/tensorlayer
Commit Name: 5307ae3f7d1c4b6bd2285f946db82d944f3844db
Time: 2019-02-19
Author: jingqing.zhang15@imperial.ac.uk
File Name: examples/text_classification/tutorial_imdb_fasttext.py
Class Name:
Method Name: train_test_and_save_model
Project Name: kmike/pymorphy2
Commit Name: 837b2efde71507b09033c3ea6f2502e2306f8eef
Time: 2013-02-18
Author: kmike84@gmail.com
File Name: pymorphy2/opencorpora_dict/storage.py
Class Name:
Method Name: save_compiled_dict
Project Name: comic/grand-challenge.org
Commit Name: a8eab99a0476060c27ae890071a5e17c01531ee7
Time: 2020-01-27
Author: 57257130+MikeOverkamp-diag@users.noreply.github.com
File Name: app/grandchallenge/reader_studies/models.py
Class Name: ReaderStudy
Method Name: add_ground_truth