yunxiaoshi / Neural-IMage-Assessment

A PyTorch Implementation of Neural IMage Assessment
Other
508 stars 92 forks source link

Problematic Implementation of EMD Loss #4

Closed VoVAllen closed 5 years ago

VoVAllen commented 5 years ago

Should be the L2 distance between CDF of two distributions but not between the PDF of two distributions

And there's some typo in the naming such as emb and emd

yunxiaoshi commented 5 years ago

As you say, the implementation is strictly mirrored from the paper, if you take a closer look you will see that the implementation is correct.

VoVAllen commented 5 years ago

Sorry for the mistake. I realized it's right. Thanks! Another minor problem I found is Dropout. Due to pytorch features, you need to explicit call model.eval() in valuation and test period to turn the Dropout into right mode to get right forward result.

yunxiaoshi commented 5 years ago

Fixed the dropout issue I didn't see any typo that you mentioned

VoVAllen commented 5 years ago

可能是我看错了……应该没有typo……

VoVAllen commented 5 years ago

Also I see you might also need to add model.eval() at valuation period

luqiang360 commented 5 years ago

https://github.com/kentsyx/Neural-IMage-Assessment/blob/9c50b3e384a88a8afdc00333d01656be5526bfed/model.py#L36

The EMD loss still seems to be wrong, my opinion is the sum operation should be inside of torch.abs