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

About whitenlearn(X, qidxs, pidxs) #74

Open
michaeltian108 opened this issue Sep 28, 2021 · 4 comments
Open

About whitenlearn(X, qidxs, pidxs) #74

michaeltian108 opened this issue Sep 28, 2021 · 4 comments

Comments

@michaeltian108
Copy link

Hi, I've been carefully reading your paper, your codes and your major references as well, all of which I found to be awesome, clear and systematic. Really enjoyed. However, I'm a bit confused when I came to read the part of the codes doing learnable whitening.

    m = X[:, qidxs].mean(axis=1, keepdims=True)
    df = X[:, qidxs] - X[:, pidxs]
    S = np.dot(df, df.T) / df.shape[1] 
    P = np.linalg.inv(cholesky(S))
    df = np.dot(P, X-m)
    D = np.dot(df, df.T)
    eigval, eigvec = np.linalg.eig(D)
    order = eigval.argsort()[::-1]
    eigval = eigval[order]
    eigvec = eigvec[:, order]
 
   P = np.dot(eigvec.T, P)

First of all, do S and D refer to Cs and Cd as you mentioned in your paper?
Everything makes sense to me until line 4 where a cholesky decomposition function is called. And I started to lose track of what exactly do P and D refer to. And I cannot understand how the P in the last line is the learned projection matrix.

I referred to the original paper and googled cholesky decomp for more details but that didn't help a lot.
Could you please simply explain what each line does from line 4?
Thank you very much for your time!
@filipradenovic

@lr87
Copy link

lr87 commented Nov 2, 2021

I noticed that filipradenovic post his doctor thesis in this issue #40
You can find the introduction of this whitening method in Page54 of the thesis.

@michaeltian108
Copy link
Author

@lr87 Thanks for your infomration. I actually do undertand the whitening process, but what I'm confused is that I cannot link the arugments here in the code with such process. But thanks again for your help!

@lr87
Copy link

lr87 commented Nov 3, 2021

@michaeltian108 After carefully reading the paper and the code, I understand what confused you, and now it confuses me, too 😓
Looking forward to the explanation from @filipradenovic

@liyongqing-1101
Copy link

Hello, this problem also confuses me, I wonder that do you figure out the codes of 'whitenlearn' in 'whiten.py'. If you do, Could you please explain the code, I'll really appreciate it.
@michaeltian108
@lr87

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

3 participants