SSARCandy / DeepCORAL

🧠 A PyTorch implementation of 'Deep CORAL: Correlation Alignment for Deep Domain Adaptation.', ECCV 2016
https://ssarcandy.tw/2017/10/31/deep-coral/
226 stars 42 forks source link

Error in calculation of covariance matrix #16

Closed harshitbansal05 closed 6 years ago

harshitbansal05 commented 6 years ago

I think that there's an error in the calculation of covariance matrices. In the line xm = torch.mean(source, 1, keepdim=True) - source, imo 1 must be replaced by 0, as I would like to calculate the mean of each feature along the entire batch. Please correct me if I am wrong. Thanks, wonderful work by the way.

SSARCandy commented 6 years ago

You're right, I'll fix it. Thanks Interestingly, this bug didn't affect the performance much, the accuracy after bug fixed is about ~58%, it is ~56% before the fix. 😕