-
Notifications
You must be signed in to change notification settings - Fork 40
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
why the performance of CCA and MCCA is different when I use them to project two views? #162
Comments
Do you have a code snippet I can use to reproduce? Otherwise will explore myself and get back to you |
from cca_zoo.models import CCA,MCCA def Initialize_Seed(seed=2): def Ori_CCA_fit_transform(multi_view,latent_dim=100,epochs=20):
def CCA_fit_transform(multi_view,latent_dim=100,epochs=20):
Initialize_Seed(2) x= [x1,x2] print((res1[0]==res2[0]).all()) |
The result of the print is False. Please try it. |
Ok the weights of these models are the same but they are normalised differently. eg if you check the correlation of res1[0] and res2[0] you will find they are +1/-1. I’ll have a look if I can tweak the MCCA eigenvalue problem to make them have the same solution in any case but the results of your code snippet aren’t too worrying in the sense that the normalisation is arbitrary |
Many thanks~
|
Notice that the loss is based on C_whitened not C so while your observation that C[0][0] is the correlation of views[0][:,0] and view[0][:,0] is correct it isn't relevant to the eigenvalues of C_whitened. In fact C_whitened[0][0] should always be 1 (subject to imprecision) and indeed the whole diagonal should be 1. The reason why we use this form for MCCA is because if you imagine the covariance matrix of all of the views we care about all of the pairwise covariances. |
https://arxiv.org/pdf/2005.11914.pdf equation 4 of this is I think the best reference for MCCA. |
Thank you so much!!! |
In the next update I have adjusted the eigenvalue problems so that these will both produce the same result. In particular the norm of the transformed training data should be sqrt(n) where n is the number of samples. |
Dear author,
I really appreciate your great work, and I am confused why the performance is different when I use CCA and MCCA.
The text was updated successfully, but these errors were encountered: