Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some mismatches between the code and the paper and some error in the code / paper. #11

Open
bad-meets-joke opened this issue Mar 10, 2023 · 0 comments

Comments

@bad-meets-joke
Copy link

bad-meets-joke commented Mar 10, 2023

Hello,

Really thank you for releasing the code. However, I find several obvious mismatches between the code and the paper, and I also find some error.

  • A = F.softmax(A,dim = -1) # compute an attention map for each attribute
    the softmax operation is along dim=-1, which represents the size of visual feature set, not like Eq. 1 in the paper
  • A = F.softmax(A,dim = 1) # compute an attention map for each attribute
    the softmax operation is along dim=1, which represents the number of attributes , not like Eq. 4 in the paper
  • S_p = torch.einsum('bir,bri->bi',A,S) # compute attribute scores from attribute attention maps
    and
    S_pp = torch.einsum('ki,bi->bik',self.att,S_p) # compute the final prediction as the product of semantic scores, attribute scores, and attention over attribute scores
    are totally different to Eq. 6 and subsequent PHI(x_i).
  • if not self.is_conservative:
    the self.is_conservative is set True, which means the denominator of the first term in Eq. 7 is summed on C not C^s
  • def compute_loss_Self_Calibrate(self,in_package):
    The sum on C^u of the second term in Eq. 7 should be placed after the symbol log
  • def compute_contrastive_loss(self, in_package1, in_package2):
    line 238-242 do not calculate the l2 distance in the right way. Line 245-249 change the predictions to probabilities by F.softmax(), and the JSD eqution in the paper is wrong.

Could you please give some explanation about these mismatches, and correct the wrong code and equations?

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant