Closed Racha1992 closed 3 years ago
bias = reshape_to_bias(self.beta - batch_mean * (self.gamma / torch.sqrt(batch_var + self.eps)))# b融batch
weight = self.weight * reshape_to_weight(self.gamma / torch.sqrt(self.running_var + self.eps)) # w融running
不太懂的地方是为什么bias融batch,weights融running?
参考,相关资料_压缩_量化_QAT_High-Bit: Quantizing deep convolutional networks for efficient inference: A whitepaper
请问在BNFold_Conv2d_Q 里边forward函数里边,在计算bias的时候: bias = reshape_to_bias(self.beta + (self.bias - batch_mean) * (self.gamma / torch.sqrt(batch_var + self.eps))) 为什么这里用的batch_mean和batch_var而不是self.running_mean和self.running_var呢?