alexandonian / contrastive-feature-loss

PyTorch implementation of Contrastive Feature Loss for Image Prediction (AIM Workshop at ICCV 2021)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problem about the stop gradient operation for negative pairs.

MosPicDev opened this issue · comments

According to the equation (5) in paper, which says that "gradients are prevented from flowing through the negatives". Then for the PatchNCELoss function in

if not self.opt.gradient_flows_to_negative_nce:
, should we detach feat_k after the calculation of pos logits?