koraykv / unsup

Some unsupervised learning modules using Torch
86 stars 36 forks source link

Whitening: functional or in place? #12

Closed clementfarabet closed 11 years ago

clementfarabet commented 11 years ago

First thanks for the whitening functions in whitening.lua. This is very useful.

One question/concern: these functions currently replace the data that's passed in by the whitened (or coloured) data. Is this the expected behavior? I think that it's probably better to leave the input data untouched. What do you think?

andreirusu commented 11 years ago

Hi Clement,

You are right, and the intended behavior was not to modify input data. I cloned the input data into auxdata in all whitening functions; then I've updated auxdata in place and returned it; will this not achieve the desired behavior?

Cheers, Andrei

clementfarabet commented 11 years ago

Hi Andrei, I spoke too fast: the problem only occurs in the colourize functions, there: zca_colour and pca_colour. zca_whiten and pca_whiten are correct.

andreirusu commented 11 years ago

Good catch, that was a bug! I've fixed it and I've issued a pull request. Thanks!

Andrei

clementfarabet commented 11 years ago

Cool, thanks for the fix! I've merged it.