Lam1360 / YOLOv3-model-pruning

在 oxford hand 数据集上对 YOLOv3 做模型剪枝(network slimming)
MIT License
1.67k stars 432 forks source link

为什么上一层丢掉的权重,下一层的BN层runing_meaning要减去offset #95

Open cqray1990 opened 3 years ago

cqray1990 commented 3 years ago

offset = conv_sum.matmul(activation.reshape(-1, 1)).reshape(-1) if next_idx in CBL_idx: next_bn = pruned_model.module_list[next_idx][1] next_bn.runningmean.data.sub(offset) else: nextconv.bias.data.add(offset)