HX-idiot / FADA-Pytorch

pytorch implement for the paper Few-Shot Adversarial Domain Adaptation
54 stars 14 forks source link

Where is the adversarial operation #4

Open XiXiRuPan opened 4 years ago

XiXiRuPan commented 4 years ago

loss_sum = loss_X1 + loss_X2 + 0.2 * loss_dcd The coefficient of loss_dcd is -0.2, is that right ?

wmbai commented 4 years ago

I've read the author's paper and code. I think the author is right. loss_dcd is based on the function "torch.nn.CrossEntropyLoss()". This function already contains "-". So there shouldn't be a "-" before "0.2*loss_dcd"

wmbai commented 4 years ago

As for your question to adversarial operation. Pay attention to "step 3" in "main.py".

" groups_2 = [G2, G4] groups_y_2 = [Y2, Y4]" indicates that they only use samples from group 2 and 4. However, "dcd_label=0 if ground_truth==0 else 2" indicates that the label (0 or 2) they used are corresponding to samples from group 1 and 3. So the "loss_dcd" they calculated is just the same adversarial loss shown in their paper. image