Created
June 8, 2019 15:20
-
-
Save vwrs/d088eb56056cb2e0d077b6acf1331325 to your computer and use it in GitHub Desktop.
print utility for checking training progress in command line
This file contains 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
import sys | |
def show_progress(e, i, t, l, v): | |
''' | |
Prints the training progress recursively. | |
Args: | |
e (int): the current epoch | |
i (int): the current batch | |
t (int): the total batches | |
l (float): the current training loss | |
v (float): the current validation loss | |
''' | |
sys.stdout.write('\r#%4d: [%5d / %5d] loss: %.4f err: %.3f' | |
% (e, i, t, l, v)) | |
sys.stdout.flush() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment