Skip to content

Commit

Permalink
Always display GROUND TRUTH. BEST OCR and ALIGNED TRUTH only if diffe…
Browse files Browse the repository at this point in the history
…rent for debug_level -1
  • Loading branch information
Shreeshrii committed Apr 4, 2019
1 parent 84d4cc2 commit 51c3535
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/lstm/lstmtrainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -879,10 +879,8 @@ Trainability LSTMTrainer::PrepareForBackward(const ImageData* trainingdata,
targets->SubtractAllFromFloat(*fwd_outputs);
if (debug_interval_ != 0) {
if (truth_text != ocr_text) {
tprintf("Iteration %d: GROUND TRUTH : %s\n",
training_iteration(), truth_text.string());
tprintf("Iteration %d: BEST OCR TEXT : %s\n", training_iteration(),
ocr_text.string());
tprintf("Iteration %d: BEST OCR TEXT : %s\n",
training_iteration(), ocr_text.string());
}
}
double char_error = ComputeCharError(truth_labels, ocr_labels);
Expand Down Expand Up @@ -1046,8 +1044,12 @@ bool LSTMTrainer::DebugLSTMTraining(const NetworkIO& inputs,
GenericVector<int> xcoords;
LabelsFromOutputs(outputs, &labels, &xcoords);
STRING text = DecodeLabels(labels);
tprintf("Iteration %d: ALIGNED TRUTH : %s\n",
tprintf("Iteration %d: GROUND TRUTH : %s\n",
training_iteration(), truth_text.string());
if (truth_text != text) {
tprintf("Iteration %d: ALIGNED TRUTH : %s\n",
training_iteration(), text.string());
}
if (debug_interval_ > 0 && training_iteration() % debug_interval_ == 0) {
tprintf("TRAINING activation path for truth string %s\n",
truth_text.string());
Expand Down

0 comments on commit 51c3535

Please sign in to comment.