summaryrefslogtreecommitdiff
path: root/models
diff options
context:
space:
mode:
authorJordan Gong <jordan.gong@protonmail.com>2021-03-02 19:26:11 +0800
committerJordan Gong <jordan.gong@protonmail.com>2021-03-02 19:26:11 +0800
commit02780c31385af7e1103448bd1994012ac95dd2bb (patch)
treea7da51ef08c44c74b1ecf9b51591efd9063f7c5f /models
parent543a35d814754c86ccafa1243bece387c1a780d6 (diff)
Record learning rate every step
Diffstat (limited to 'models')
-rw-r--r--models/model.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/models/model.py b/models/model.py
index 3242141..acccbff 100644
--- a/models/model.py
+++ b/models/model.py
@@ -282,13 +282,14 @@ class Model:
'Embedding/PartNet norm', mean_pa_norm,
self.k, self.pr * self.k, self.curr_iter
)
+ # Learning rate
+ lrs = self.scheduler.get_last_lr()
+ # Write learning rates
+ self.writer.add_scalar(
+ 'Learning rate', lrs[0], self.curr_iter
+ )
if self.curr_iter % 100 == 0:
- lrs = self.scheduler.get_last_lr()
- # Write learning rates
- self.writer.add_scalar(
- 'Learning rate', lrs[0], self.curr_iter
- )
# Write disentangled images
if self.image_log_on:
i_a, i_c, i_p = images