Created
December 5, 2016 12:42
-
-
Save nihemak/718ce6aaaed40cf8493396f8f25589ed to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from Translator import Translator | |
import time | |
# 英日翻訳の学習 | |
start_time = time.time() | |
print("model new start.") | |
model = Translator(True) | |
elapsed_time = time.time() - start_time | |
print("model new finished. elapsed_time: {0:.1f}[sec]".format(elapsed_time)) | |
epoch_num = 100 | |
for epoch in range(epoch_num): | |
start_time = time.time() | |
print("{0} / {1} epoch start.".format(epoch + 1, epoch_num)) | |
# 学習を実施 | |
model.learn(True) | |
modelfile = "en2ja-" + str(epoch) + ".model" | |
model.save_model(modelfile) | |
elapsed_time = time.time() - start_time | |
remaining_time = elapsed_time * (epoch_num - epoch - 1) | |
print("{0} / {1} epoch finished.".format(epoch + 1, epoch_num), end="") | |
print(" elapsed_time: {0:.1f}[sec]".format(elapsed_time), end="") | |
print(" remaining_time: {0:.1f}[sec]".format(remaining_time)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://nihemak.hatenablog.com/entry/2016/12/06/010550