params = [] for key, value in dict(FPN.named_parameters()).items(): if value.requires_grad: if 'bias' in key: params += [{'params': [value], 'lr': lr * (cfg.TRAIN.DOUBLE_BIAS + 1), \ 'weight_decay': cfg.TRAIN.BIAS_DECAY and cfg.TRAIN.WEIGHT_DECAY or 0}] else: params += [{'params': [value], 'lr': lr, 'weight_decay': cfg.TRAIN.WEIGHT_DECAY}]
I have some incomprehension about this part of code in trainval_net.py, can you tell the meaning of this part, and we do that for the reason of frozen layers?
The code means that:
1) only count the params which are require grad
2) we can choose double lr for bias or not
3) choose lr for weights
And choosing double lr for bias has something special effects?
params = [] for key, value in dict(FPN.named_parameters()).items(): if value.requires_grad: if 'bias' in key: params += [{'params': [value], 'lr': lr * (cfg.TRAIN.DOUBLE_BIAS + 1), \ 'weight_decay': cfg.TRAIN.BIAS_DECAY and cfg.TRAIN.WEIGHT_DECAY or 0}] else: params += [{'params': [value], 'lr': lr, 'weight_decay': cfg.TRAIN.WEIGHT_DECAY}]
I have some incomprehension about this part of code in trainval_net.py, can you tell the meaning of this part, and we do that for the reason of frozen layers?