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

Weights all zero #26

Open
nienkevanunen opened this issue Oct 19, 2021 · 4 comments
Open

Weights all zero #26

nienkevanunen opened this issue Oct 19, 2021 · 4 comments

Comments

@nienkevanunen
Copy link

nienkevanunen commented Oct 19, 2021

Hello,

I've been using this package for a short while now to try to do cross modal retrieval. However, for some reason my weights are always zero or near zero (e.g. -0.001), no matter what combination of data I use, or what combination of components and regularization. And this is not the case when I run the example notebook. Additionally, when I use other cca packages, it is also not happening. What could be the cause of this? Surely the predictions can't be that great if the weights that it is using are zero...

image

@TomDLT
Copy link
Contributor

TomDLT commented Oct 19, 2021

Hi, have you tried rescaling your input data, for example dividing the arrays with their standard deviation ?

@nienkevanunen
Copy link
Author

Hi, have you tried rescaling your input data, for example dividing the arrays with their standard deviation ?

I hadn't, but that has certainly changed things. Thank you for the tip!

@nienkevanunen
Copy link
Author

Though, as soon as I add any regularization (the example above used 0), all the weights are back to 0.

@nienkevanunen nienkevanunen reopened this Oct 19, 2021
@TomDLT
Copy link
Contributor

TomDLT commented Oct 20, 2021

What values did you use for regularization ?
Adequate regularization can vary by several orders of magnitude depending on the problem.
See for example the default range of regularization in CCACrossValidate, from 1e-3 to 1e1:

regs = np.array(np.logspace(-3, 1, 10)) if regs is None else regs

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