Advertisement
CookiePPP

Untitled

Dec 26th, 2019
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.58 KB | None | 0 0
  1. replace
  2.             for param_group in optimizer.param_groups:
  3.                 param_group['lr'] = learning_rate
  4.  
  5.  
  6.  
  7. with
  8.  
  9.  
  10.  
  11.             decay_start = 25000
  12.             A_ = 1e-3
  13.             B_ = 8000
  14.             C_ = 1e-5
  15.             if iteration < decay_start:
  16.                 learning_rate = A_
  17.             else:
  18.                 iteration_adjusted = iteration - decay_start
  19.                 learning_rate = (A_*(e**(-iteration_adjusted/B_))) + C_ # y = Ae^(-x/B) + C
  20.             for param_group in optimizer.param_groups:
  21.                 param_group['lr'] = learning_rate
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement