micronet, a model compression and deploy lib. compression: 1、quantization: quantization-aware-training(QAT), High-Bit(>2b)(DoReFa/Quantization and Training of Neural Networks for Efficient Integer-Arithmetic-Only Inference)、Low-Bit(≤2b)/Ternary and Binary(TWN/BNN/XNOR-Net); post-training-quantization(PTQ), 8-bit(tensorrt); 2、 pruning: normal、regular and group convolutional channel pruning; 3、 group convolution structure; 4、batch-normalization fuse for quantization. deploy: tensorrt, fp32/fp16/int8(ptq-calibration)、op-adapt(upsample)、dynamic_shape
你好: in quantization/WqAq/IAO/models/util_wqaq.py if self.bias is not None:
bias = reshape_to_bias(self.beta + (self.bias - batch_mean) (self.gamma / torch.sqrt(batch_var + self.eps))) else: bias = reshape_to_bias(self.beta - batch_mean (self.gamma / torch.sqrt(batch_var + self.eps))) weight = self.weight reshape_to_weight(self.gamma / torch.sqrt(self.running_var + self.eps))
为什么torch.sqrt()里面batch_var不使用平方,类似于这种: bias = reshape_to_bias(self.beta + (self.bias - batch_mean) (self.gamma / torch.sqrt(batch_varbatch_var + self.eps))) weight = self.weight reshape_to_weight(self.gamma / torch.sqrt(self.running_var*self.runing_var + self.eps)) 期待您的回复。