Created
December 15, 2017 03:57
-
-
Save bzamecnik/00b1885971466b7556e0c1807273c76b to your computer and use it in GitHub Desktop.
Keras progress bar with millisecond precision by default (for both epoch and step time).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/keras/utils/generic_utils.py b/keras/utils/generic_utils.py | |
index 6a97448..d1db340 100644 | |
--- a/keras/utils/generic_utils.py | |
+++ b/keras/utils/generic_utils.py | |
@@ -292,7 +292,7 @@ class Progbar(object): | |
self.seen_so_far = current | |
now = time.time() | |
- info = ' - %.0fs' % (now - self.start) | |
+ info = ' - %.0f ms' % (1e3 * (now - self.start)) | |
if self.verbose == 1: | |
if (not force and (now - self.last_update) < self.interval and | |
current < self.target): | |
@@ -340,12 +340,13 @@ class Progbar(object): | |
info = ' - ETA: %s' % eta_format | |
else: | |
- if time_per_unit >= 1: | |
- info += ' %.0fs/step' % time_per_unit | |
- elif time_per_unit >= 1e-3: | |
- info += ' %.0fms/step' % (time_per_unit * 1e3) | |
+ #if time_per_unit >= 1: | |
+ # info += ' %.0fs/step' % time_per_unit | |
+ #elif time_per_unit >= 1e-3: | |
+ if time_per_unit >= 1e-3: | |
+ info += ' %.0f ms/step' % (time_per_unit * 1e3) | |
else: | |
- info += ' %.0fus/step' % (time_per_unit * 1e6) | |
+ info += ' %.0f us/step' % (time_per_unit * 1e6) | |
for k in self.unique_values: | |
info += ' - %s:' % k |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment