Advertisement
Guest User

Untitled

a guest
Feb 21st, 2018
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. # model training progress bar
  2. def update_progress(progress):
  3. barLength = 30
  4. status = ""
  5. if isinstance(progress, int):
  6. progress = float(progress)
  7. if progress >= 1:
  8. progress = 1
  9. block = int(round(barLength*progress))
  10. text = "\rPercent: [{0}] {1}% {2}".format( "*"*block + "-"*(barLength-block), round(progress*100), status)
  11. sys.stdout.write(text)
  12. sys.stdout.flush()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement