Commit adbd5da4 by xiaotong

fix bug of wrong display of training epoch number

parent ad40df03
......@@ -123,7 +123,7 @@ void T2TTrainer::Train(const char * fn, T2TModel * model)
double startT = GetClockSec();
for(epoch = 0; epoch < nepoch; epoch++){
for(epoch = 1; epoch <= nepoch; epoch++){
FILE * file = fopen(fn, "rb");
CheckNTErrors(file, "cannot open training file!");
......@@ -179,7 +179,7 @@ void T2TTrainer::Train(const char * fn, T2TModel * model)
if (step % 1 == 0) {
double elapsed = GetClockSec() - startT;
XPRINT7(0, stderr, "[INFO] lr=%.2e, elapsed=%.1fs, step=%d, epoch=%d, word=%d, ppl=%.3f, sppl=%.3f\n",
lr, elapsed, step, epoch + 1, wordCountTotal, exp(loss / wordCount), exp(-prob/wc));
lr, elapsed, step, epoch, wordCountTotal, exp(loss / wordCount), exp(-prob/wc));
}
if(mem != NULL && mem->mode == UNI_FREE)
......@@ -200,9 +200,9 @@ void T2TTrainer::Train(const char * fn, T2TModel * model)
fclose(tf);
XPRINT6(0, stderr, "[INFO] lr=%.2e, elapsed=%.1fs, step=%d, epoch=%d, word=%d, ppl=%.3f\n",
lr, elapsed, step, epoch + 1, wordCountTotal, exp(loss / wordCount));
lr, elapsed, step, epoch, wordCountTotal, exp(loss / wordCount));
XPRINT3(0, stderr, "[INFO] training finished (took %.1fs, step=%d and epoch=%d)\n",
elapsed, step, epoch + 1);
elapsed, step, epoch);
}
/*
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论