Albert0147/NRC_SFDA

paper and code implementation are different

Closed this issue · 2 comments

Thank your for nice job!
I notice that you use dot-product to measure simlarity between prediction in paper while use KL_div in code.

paper:
image

code:

loss += torch.mean(
(F.kl_div(softmax_out_un, score_near, reduction='none').sum(-1) *
weight.cuda()).sum(1)) #

I wonder why do you do this?
Thanks!

Hi, if you check pytorch document of kl_div, you will find they are indentical, without log here is just dot product.

...thanks 🤣