File size: 304 Bytes
2cdd41c
1615d09
2cdd41c
 
 
1615d09
2cdd41c
1615d09
2cdd41c
1
2
3
4
5
6
7
8
9
10
class LRMult(object):
    def __init__(self, lr_mult=1.0):
        self.lr_mult = lr_mult

    def __call__(self, m):
        if getattr(m, "weight", None) is not None:
            m.weight.lr_mult = self.lr_mult
        if getattr(m, "bias", None) is not None:
            m.bias.lr_mult = self.lr_mult