From 99dfa8a68074912199f6c36f795e41407e8a9295 Mon Sep 17 00:00:00 2001 From: Shreeshrii Date: Sat, 9 Nov 2019 16:52:40 +0530 Subject: [PATCH] Add separator and training_iteration to checkpoint name (#2752) * Add separator and training_iteration to checkpoint name * specify modelname_N.NN_NN_NN.checkpoint for intermediate checkpoint --- doc/lstmeval.1.asc | 4 ++-- src/training/lstmtrainer.cpp | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/doc/lstmeval.1.asc b/doc/lstmeval.1.asc index 5fae045e..202d2401 100644 --- a/doc/lstmeval.1.asc +++ b/doc/lstmeval.1.asc @@ -8,11 +8,11 @@ lstmeval - Evaluation program for LSTM-based networks. SYNOPSIS -------- -*lstmeval* --model 'lang.lstm|langtrain_checkpoint|pluscharsN.NNN_NN.checkpoint' [--traineddata lang/lang.traineddata] --eval_listfile 'lang.eval_files.txt' [--verbosity N] [--max_image_MB NNNN] +*lstmeval* --model 'lang.lstm|modelname_checkpoint|modelname_N.NN_NN_NN.checkpoint' [--traineddata lang/lang.traineddata] --eval_listfile 'lang.eval_files.txt' [--verbosity N] [--max_image_MB NNNN] DESCRIPTION ----------- -lstmeval(1) evaluates LSTM-based networks. Either a recognition model or a training checkpoint can be given as input for evaluation along with a list of lstmf files. If evaluating a training checkpoint, '--traineddata' should also be specified. +lstmeval(1) evaluates LSTM-based networks. Either a recognition model or a training checkpoint can be given as input for evaluation along with a list of lstmf files. If evaluating a training checkpoint, '--traineddata' should also be specified. Intermediate training checkpoints can also be used. OPTIONS ------- diff --git a/src/training/lstmtrainer.cpp b/src/training/lstmtrainer.cpp index eb3f15d4..903e5cbc 100644 --- a/src/training/lstmtrainer.cpp +++ b/src/training/lstmtrainer.cpp @@ -910,11 +910,13 @@ void LSTMTrainer::SaveRecognitionDump(GenericVector* data) const { } // Returns a suitable filename for a training dump, based on the model_base_, -// the iteration and the error rates. +// best_error_rate_, best_iteration_ and training_iteration_. STRING LSTMTrainer::DumpFilename() const { STRING filename; - filename.add_str_double(model_base_.c_str(), best_error_rate_); + filename += model_base_.c_str(); + filename.add_str_double("_", best_error_rate_); filename.add_str_int("_", best_iteration_); + filename.add_str_int("_", training_iteration_); filename += ".checkpoint"; return filename; }