Use @property

This commit is contained in:
Yuta Hayashibe
2023-10-27 18:14:27 +09:00
parent efef5c8ead
commit 0d21925bdf
5 changed files with 10 additions and 9 deletions

View File

@@ -4700,5 +4700,6 @@ class LossRecorder:
self.loss_list[step] = loss
self.loss_total += loss
def get_moving_average(self) -> float:
@property
def moving_average(self) -> float:
return self.loss_total / len(self.loss_list)