XiaoxiaSun / supervised-deep-sparse-coding-networks

supervised deep sparse coding networks
Other
30 stars 12 forks source link

A training problem in mnist #1

Closed MaxLingwei closed 7 years ago

MaxLingwei commented 7 years ago

Hello Xiaoxia, I've read your paper and I'm interested in your work. I downloaded your code and tried to reproduce the result on MNIST. But I got an error in the file fista_nonnegative_l1_gpu.m, line 19, const_x = Linv*DtY - lambdaLinv; Here the error information is Matrix dimensions must agree. I have check the matrix. Linv is 1x1 gpuArray. DtY is 8x100352 gpuArray. lambdaLinv is 8x1 gpuArray. It seams that there is something wrong with the matrix size. So would you spend some time to check the code and answer my question? Thank you very much!

XiaoxiaSun commented 7 years ago

@MaxLingwei Thanks for your interest in my work. This is an issue happens when a relatively old version MATLAB is used. Before MATLAB 2016b, it does not support A - b, where A is MxN and b is Mx1, but this operation is supported after (and include) 2016b, which equals to bxfun(@minus, A, b). To solve this problem, you can change the line: const_x = LinvDtY - lambdaLinv; into: const_x = bsxfun(@minus, LinvDtY, lambdaLinv); I believe a similar problem might occur during backpropagation. If so, please conduct a similar change.

MaxLingwei commented 7 years ago

@XiaoxiaSun Thank you very much! I've solved the problem. It's very nice for you.