Merge pull request #6 from cdtools-developers/report_msg

CDIModel: Refactor report method
This commit is contained in:
allevitan authored and GitHub committed 2024-11-19 09:19:58 +01:00
commit 93a5083455
1 file changed
+7 -4
+7 -4
View File
@@ -703,11 +703,14 @@ class CDIModel(t.nn.Module):
A string with basic info on the latest iteration
"""
if hasattr(self, 'latest_iteration_time'):
return 'Epoch ' + str(len(self.loss_history)) + \
' completed in %0.2f s with loss ' %\
self.latest_iteration_time + str(self.loss_history[-1])
epoch = len(self.loss_history)
dt = self.latest_iteration_time
loss = self.loss_history[-1]
msg = f'Epoch {epoch:3d} completed in {dt:0.2f} s with loss {loss:.5e}'
else:
return 'No reconstruction iterations performed yet!'
msg = 'No reconstruction iterations performed yet!'
return msg
# By default, the plot_list is empty
plot_list = []