GlassyWu / AECR-Net

Contrastive Learning for Compact Single Image Dehazing, CVPR2021
344 stars 49 forks source link

Confusion regarding implementation of Contrastive Loss #5

Open rushi-the-neural-arch opened 3 years ago

rushi-the-neural-arch commented 3 years ago

Hi! Using Contrastive Loss is indeed an impressive idea! However, I am confused as to how this loss is being calculated and updated. Do you flatten the model output and compare(use contrastive loss) it with the flattened Target output?? And if we also use L1 loss, how do we update the model weights using both L1 and Contrastive Loss function?? I hope the PyTorch code will be updated soon enough, it might give some more clarity.

Thanks!