Prev: Low pass filter
Next: Multiple Bar Graphs
From: Bruno Luong on 27 May 2010 15:38 I recognize you are working on NMR T2 distribution, which triggers my sympathy. ;-) Just a question, if you have one algorithm (lsqnonneg) that works fine, why insisting on using the other? Bruno
From: Dushyant Kumar on 27 May 2010 16:39 "Bruno Luong" <b.luong(a)fogale.findmycountry> wrote in message <htmhms$8sk$1(a)fred.mathworks.com>... > I recognize you are working on NMR T2 distribution, which triggers my sympathy. ;-) > > Just a question, if you have one algorithm (lsqnonneg) that works fine, why insisting on using the other? > > Bruno You are quite close, it's T2-relaxometry in MRI. Seems like you may be able to guid me in right direction. I intend to SOLVE for 10 thousand voxels (a slice of brain volume) or entire brain volume which would be 1 millon. If I use lsqnonneg, speed decreases a lot. Below is my report for 36 voxels. =========== In case of solver lsqlin, the top 5 time taking functions, their no of calls and time taken are respectively: lsqnonneg-----1-----7.5079 lsqlin-----1-----1.432 optim\private\sllsbox-----1-----1.408 optim\private\drqpbox-----2-----1.257 aprecon-----2-----0.81899 Total time taken = 9.9762 Here even if my primary solver is lsqlin, I do have to use lsqnonneg for non-regularized smaller problem and get intial estimate of x0. Using lsqlin even to get x0 gives me warning: Warning: Large-scale method requires at least as many equations as variables in C matrix; using medium-scale method instead. and code takes for ever. =========== In case of solver lsqnonneg, the top 5 time taking codes, their no of calls and time taken are respectively: lsqnonneg-----2-----509.8306 kron-----39-----0.207 Test_LSQNONNEG_n_SpatialReg>Create_AComp_Matrix-----1-----0.206 newplot-----72-----0.189 Test_LSQNONNEG_n_SpatialReg>calculate_Ds_row-----36-----0.18 Total time taken = 510.5874 =========== Do you think that using matlab cluster would help? I have access at cornell.
From: Bruno Luong on 27 May 2010 18:04 Just a quick comment before I take some sleep. The problem of estimate T2 distribution is extremely ill-conditioned. It is too demanding to ask the residual to goes down to 1e-8. The test case you make is without noise. Try it with noise, and you'll see that the residual norm you aim for will be no longer relevant. The main difference between lsqnonneg and lsqnonlin you see here is the algorithms treat the active set. lsqnonneg handle better because the box constraints is simpler. But you'll see that in the presence of noise, (eg use the following: Image_3D = Image_3D + 0.1*randn(size(Image_3D));) you won't be bother anymore with such detail about residual norm. The more important thing you should focus on is how to choose the regularization terms in your system. I can't test lsqnonneg because I don't have opt toolbox, but I have my own other optimization functions. More about the discussion later. Bruno
From: Dushyant Kumar on 28 May 2010 10:26 "Bruno Luong" <b.luong(a)fogale.findmycountry> wrote in message > > More about the discussion later. > > Bruno Hi, I really appreciate you helping me out. lsqnonneg can handle noisy data pretty well. However, only for fewer voxel else it becomes slow. If I use the original data, lsqnonneg returns me good solution. However, if I normalize i.e. y_exp = y_exp./y_exp(1) where y_exp =10 ~ 1000. it returns me solution similar to lsqlin. So, I have hope that if I can push lsqlin for lower value of resnorm, I can get much better solution. The results are: http://docs.google.com/Doc?docid=0AUAh9soYnrlIZGZ4dDNoc2NfOTlkbXhiNzVneA&hl=en The code is at: http://docs.google.com/leaf?id=0B0Ah9soYnrlIODRjOTExMzktNjY2Zi00YmEyLWE0YTEtYjRlNTJlOTAxZDM5&hl=en The normalization tag is in the very beginning of the code: Normalization = 'Yes'; Normalization = 'No'; Regards, DK
From: Dushyant Kumar on 28 May 2010 12:14
"Bruno Luong" <b.luong(a)fogale.findmycountry> wrote in message <htmq8n$rd1$1(a)fred.mathworks.com>... > The main difference between lsqnonneg and lsqnonlin you see here is the algorithms treat the active set. lsqnonneg handle better because the box constraints is simpler. > > Bruno It seems you are right. With noise included, lsqnonneg and lsqlin has similar performance. So, I may be able to use lsqlin. However, if possible, can you briefly explain: (i) Why lsqlin is faster? I was told that even lsqnonneg preserve the sparsity pattern. (ii)Can not I make the box constraint in lsqlin simpler as well? (iii) Would you mind sharing your version of lsqnonneg so that I can have a look and see how algorithm works? (iv) Also, I was trying to locate the stopping criteria inside the code. I could not find there. It seems that it may be handled by some other function. If you know the name, would you please let me know? Regards, Dushyant |