Skip to content

Commit

Permalink
make training checks params at end of each epoch
Browse files Browse the repository at this point in the history
  • Loading branch information
PengNi committed Nov 23, 2021
1 parent e9327d8 commit 7733fce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion deepsignal_plant/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def train(args):
torch.nn.utils.clip_grad_norm_(model.parameters(), 0.5)
optimizer.step()

if (i + 1) % args.step_interval == 0:
if (i + 1) % args.step_interval == 0 or i == total_step - 1:
model.eval()
with torch.no_grad():
vlosses, vlabels_total, vpredicted_total = [], [], []
Expand Down

0 comments on commit 7733fce

Please sign in to comment.