Closed chenxiaodanhit closed 2 years ago
Hey @chenxiaodanhit, thanks for your interest in our work. The above implementation is equivalent to L{amp} and L{phase} as defined in the paper. To explain, the torch.tril
and torch.triu
lines ensure that the similarity matrix when i == j
is omitted, and logits
calculates the log softmax term for all indices, but we have to perform selection on the appropriate indices, as performed by the last line of code. Hope this helps.
Thanks for your reply!
Thanks for your great work! Could you please explain the instance contrastive loss as written in cost.py?
The above defination is different from the L{amp} and L{phase} noted in the paper.
Look forward to your reply! Thanks in advance!