revised status

This commit is contained in:
2025-12-17 13:15:09 +01:00
parent 99657265af
commit 575ceb4ef1
2 changed files with 21 additions and 23 deletions
+14 -12
View File
@@ -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