Skip to content

Commit 1558343

Browse files
committed
Move the LR scheduler to the last of each epoch
1 parent d1601b1 commit 1558343

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Note that the crystal graph represents only a repeating unit of [a periodic grap
1515
## Requirements
1616

1717
* Python 3.7
18-
* PyTorch 1.0
18+
* PyTorch 1.1+
1919
* Pandas
2020
* Matplotlib (necessary for plotting scripts)
2121

src/model_utils.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,6 @@ def train(self, train_dl, val_dl, num_epochs):
123123
for epoch in range(num_epochs):
124124
epoch_since = time.time()
125125
print('Epoch {}/{}'.format(epoch, num_epochs - 1), flush=True)
126-
127-
self.scheduler.step()
128126
print('current lr:', self.optimizer.param_groups[0]['lr'])
129127

130128
train_val_metrics = []
@@ -148,6 +146,7 @@ def train(self, train_dl, val_dl, num_epochs):
148146
checkpoint.check(metric)
149147
train_val_metrics += [('_'.join([phase, name]), metric) for name, metric in epoch_metrics]
150148
history.write(epoch, train_val_metrics)
149+
self.scheduler.step()
151150
time_elapsed = time.time() - epoch_since
152151
print('Elapsed time (sec.): {:.3f}'.format(time_elapsed))
153152
print()

0 commit comments

Comments
 (0)