yhhhli / BRECQ

Pytorch implementation of BRECQ, ICLR 2021

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Why loss function value is too high? Is it expecteted result?

padeirocarlos opened this issue · comments

I tried running your code for with a pre-trained ResNet50 and MobilieNetV2 model. I got loss function value for output and pred losses:

rec_loss = lp_loss(pred, tgt, p=self.p)
:param pred: output from quantized model
:param tgt: output from FP model
https://github.com/yhhhli/BRECQ/blob/main/quant/block_recon.py#L149

pd_loss = self.pd_loss(F.log_softmax(output / self.T, dim=1), F.softmax(output_fp / self.T, dim=1)) / self.lam
:param pred: output from quantized model
:param tgt: output from FP model
https://github.com/yhhhli/BRECQ/blob/main/quant/block_recon.py#L151

Are there additional settings I missed?