Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

covariance function in cifar/discrepancy.py seems strange #7

Open
Cascol-Chen opened this issue Jan 7, 2023 · 2 comments
Open

covariance function in cifar/discrepancy.py seems strange #7

Cascol-Chen opened this issue Jan 7, 2023 · 2 comments

Comments

@Cascol-Chen
Copy link

Cascol-Chen commented Jan 7, 2023

I'm confused of how the covariance is calculated in the code, the result of covariance function is different from what np.cov gives. I'm sorry if I have misunderstood.

@Cascol-Chen
Copy link
Author

Cascol-Chen commented Jan 7, 2023

Also, the ttt++.py as shown from line 286-289:

  1. get queue
  2. update queue's feature with feat_ext
  3. concat feat_ext with queue's feature.

However, feat_ext in the second step will be used twice when calculating covariance in line 292. A toy sample is shown as below.
image

@YuejiangLIU
Copy link
Contributor

Thanks for your interest.

My torch implementation of covariance is based on the Eq~2 of the Deep Coral.

From my quick test, it produces the same results as the official NumPy API (fig below).

Could you please verify the test case on your end, and share your findings if you find anything incorrect?

image

Thanks,
Yuejiang

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants