thuml / Xlearn

Transfer Learning Library
465 stars 155 forks source link

Questions about the MMD loss #29

Open taylover-pei opened 5 years ago

taylover-pei commented 5 years ago

You have done a great job.

But I have a question about the MMD Loss. The proposed MMD Loss in the paper are as follows, we can see that source domain data is paired with each other so as to the target domain data. image

For exsample, if the batch size is 10 for source and target domain, there are 100 pairs in the first iterm of the loss, 100 pairs in the second iterm of the loss and 100 pairs in the third iterm of the loss.

But, in your code just as follows, there are only 10 pairs in the first iterm of the loss, 10 pairs in the second iterm of the loss and 20pairs in the third iterm of the loss.

image

So, I think this code did not match to the original loss propsosed in paper, can you explain it to me?

Thank you very much. Looking forward to your reply.

sy565612345 commented 5 years ago

It's an unbiased estimation of MMD with linear complexity, and you can find it in the DAN paper. We have updated the code and both the batch MMD and linear estimation of MMD are included.

XXING1999 commented 2 years ago

image and there may be an error. It should be kernels[t1,s2]