From 544cd7d3408191a9cabb5e0f2e6e83e2a2a7782e Mon Sep 17 00:00:00 2001 From: Jordan Gong Date: Tue, 12 Jan 2021 20:32:21 +0800 Subject: Set default learning rate --- models/model.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'models/model.py') diff --git a/models/model.py b/models/model.py index aad0a99..b86a050 100644 --- a/models/model.py +++ b/models/model.py @@ -118,8 +118,8 @@ class Model: # Prepare for optimizer and scheduler optim_hp = self.hp.get('optimizer', {}) # Scale learning rate to world size - if optim_hp['lr']: - optim_hp['lr'] *= xm.xrt_world_size() + lr = optim_hp.get('lr', '1-e3') + optim_hp['lr'] = lr * xm.xrt_world_size() sched_hp = self.hp.get('scheduler', {}) device = xm.xla_device() rgb_pn = wrapped_rgb_pn.to(device) -- cgit v1.2.3