ruoqianguo / DetNet_pytorch

An implementation of DetNet: A Backbone network for Object Detection.
MIT License
377 stars 117 forks source link

net.parameters #8

Closed ran337287 closed 5 years ago

ran337287 commented 6 years ago

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?

ran337287 commented 6 years ago

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?