-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathProgressBar.py
More file actions
33 lines (17 loc) · 916 Bytes
/
ProgressBar.py
File metadata and controls
33 lines (17 loc) · 916 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Author : V I S H W A S [https://github.com/vstark21]
import sys
# Progress Bar class to output the progress
class ProgressBar:
def __init__(self, total_count):
self.total_count = total_count
def update(self, present_count):
percent = int((present_count / self.total_count) * 25) + 1
sys.stdout.write('\r')
sys.stdout.write("Epoch : [ " + "> " * percent + "= " * (25 - percent) + "] " + str(present_count) + " / " + str(self.total_count))
def update_with_loss(self, present_count, loss_acc):
loss, accuracy = loss_acc
percent = int((present_count / self.total_count) * 25) + 1
sys.stdout.write('\r')
sys.stdout.write("Epoch : [ " + "> " * percent + "= " * (25 - percent) + "] " + str(present_count) + " / " + str(self.total_count) + " Loss: " + str(loss) + " Accuracy: " + str(accuracy))
def end(self):
print()