revised status
This commit is contained in:
+14
-12
@@ -1,16 +1,18 @@
|
||||
class Status:
|
||||
def __init__(self):
|
||||
self.progress = 0
|
||||
self.err = -1.0
|
||||
self.err_total = -1.0
|
||||
self.l1 = -1.0
|
||||
self.l2 = -1.0
|
||||
self.progress = -1
|
||||
|
||||
def on_change(self) -> bool:
|
||||
print("-------------------------------------------")
|
||||
print(f"Progress : {self.progress} %")
|
||||
print(f"error (per mini batch) : {self.err}")
|
||||
print(f"error (total) : {self.err_total}")
|
||||
print(f"L1 : {self.l1}")
|
||||
print(f"L2 : {self.l2}")
|
||||
def on_change(self, status: dict) -> bool:
|
||||
if status == {}:
|
||||
self.progress = -1
|
||||
|
||||
if "progress" in status.keys():
|
||||
progress = status["progress"]['value']
|
||||
if self.progress < 0 or progress - self.progress >= 10:
|
||||
self.progress = progress
|
||||
print("-------------------------------------------")
|
||||
for key in status.keys():
|
||||
value = status[key]['value']
|
||||
unit = status[key]['unit']
|
||||
print(f"{key} : {value}{unit}")
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user