Skip to content

Commit 84d4cc2

Browse files
committed
Display OCR TEXT and GROUND TRUTH only when different for debug_level = -1
1 parent 2a1d238 commit 84d4cc2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/lstm/lstmtrainer.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -878,8 +878,12 @@ Trainability LSTMTrainer::PrepareForBackward(const ImageData* trainingdata,
878878
STRING truth_text = DecodeLabels(truth_labels);
879879
targets->SubtractAllFromFloat(*fwd_outputs);
880880
if (debug_interval_ != 0) {
881-
tprintf("Iteration %d: BEST OCR TEXT : %s\n", training_iteration(),
881+
if (truth_text != ocr_text) {
882+
tprintf("Iteration %d: GROUND TRUTH : %s\n",
883+
training_iteration(), truth_text.string());
884+
tprintf("Iteration %d: BEST OCR TEXT : %s\n", training_iteration(),
882885
ocr_text.string());
886+
}
883887
}
884888
double char_error = ComputeCharError(truth_labels, ocr_labels);
885889
double word_error = ComputeWordError(&truth_text, &ocr_text);

0 commit comments

Comments
 (0)