Skip to content

Instantly share code, notes, and snippets.

@vwrs
Created June 8, 2019 15:20
Show Gist options
  • Save vwrs/d088eb56056cb2e0d077b6acf1331325 to your computer and use it in GitHub Desktop.
Save vwrs/d088eb56056cb2e0d077b6acf1331325 to your computer and use it in GitHub Desktop.
print utility for checking training progress in command line
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