mirror of
https://github.com/KaiyangZhou/deep-person-reid.git
synced 2025-06-03 14:53:23 +08:00
add torchtools
This commit is contained in:
parent
9dd1d48d3c
commit
ade721922c
10
utils/torchtools.py
Normal file
10
utils/torchtools.py
Normal file
@ -0,0 +1,10 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
|
||||
import torch
|
||||
|
||||
|
||||
def adjust_learning_rate(optimizer, base_lr, epoch, stepsize, gamma=0.1):
|
||||
lr = base_lr * (gamma ** (epoch // stepsize))
|
||||
for param_group in optimizer.param_groups:
|
||||
param_group['lr'] = lr
|
Loading…
x
Reference in New Issue
Block a user