pyrcca icon indicating copy to clipboard operation
pyrcca copied to clipboard

Weights all zero

Open nienkevanunen opened this issue 3 years ago • 4 comments

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

nienkevanunen avatar Oct 19 '21 11:10 nienkevanunen

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

TomDLT avatar Oct 19 '21 18:10 TomDLT

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 avatar Oct 19 '21 19:10 nienkevanunen

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

nienkevanunen avatar Oct 19 '21 20:10 nienkevanunen

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: https://github.com/gallantlab/pyrcca/blob/bc60f25a8e395baf495dd0f7234a68490ed16a22/rcca/rcca.py#L160

TomDLT avatar Oct 20 '21 20:10 TomDLT