Skip to content
Snippets Groups Projects
Commit 182b62de authored by Franck Dary's avatar Franck Dary
Browse files

Improved prints

parent 5d2ef7b9
No related branches found
No related tags found
No related merge requests found
......@@ -63,7 +63,7 @@ void Decoder::decode(BaseConfig & config, std::size_t beamSize, bool debug, bool
auto actualTime = std::chrono::high_resolution_clock::now();
double seconds = std::chrono::duration<double, std::milli>(actualTime-pastTime).count() / 1000.0;
pastTime = actualTime;
fmt::print(stderr, "\rdecoding... speed={:<5}ex/s\r", (int)(nbExamplesProcessed/seconds));
fmt::print(stderr, "\r{:80}\rdecoding... speed={:<6}ex/s\r", "", (int)(nbExamplesProcessed/seconds));
nbExamplesProcessed = 0;
}
......
......@@ -134,9 +134,9 @@ float Trainer::processDataset(DataLoader & loader, bool train, bool printAdvance
double seconds = std::chrono::duration<double, std::milli>(actualTime-pastTime).count() / 1000.0;
pastTime = actualTime;
if (train)
fmt::print(stderr, "\rcurrent epoch : {:6.2f}% loss={:<7.3f} speed={:<6}ex/s", 100.0*(currentBatchNumber*batchSize)/nbExamples, lossSoFar, (int)(nbExamplesProcessed/seconds));
fmt::print(stderr, "\r{:80}\rcurrent epoch : {:6.2f}% loss={:<7.3f} speed={:<6}ex/s", "", 100.0*(currentBatchNumber*batchSize)/nbExamples, lossSoFar, (int)(nbExamplesProcessed/seconds));
else
fmt::print(stderr, "\reval on dev : loss={:<7.3f} speed={:<6}ex/s", lossSoFar, (int)(nbExamplesProcessed/seconds));
fmt::print(stderr, "\r{:80}\reval on dev : loss={:<7.3f} speed={:<6}ex/s", "", lossSoFar, (int)(nbExamplesProcessed/seconds));
lossSoFar = 0;
nbExamplesProcessed = 0;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment