The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: computation time of function lsqnonlin
Replies: 12   Last Post: Sep 17, 2013 5:24 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 95
Registered: 2/11/09
Re: computation time of function lsqnonlin
Posted: Sep 17, 2013 5:24 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Rakesh Kumar" wrote in message <l1aa18$7n5$>...
> "Toan Cao" <> wrote in message <l17cvm$558$>...
> > "Eric Sampson" wrote in message <l17906$ac5$>...
> > > "Toan Cao" <> wrote in message <l11tt6$c0q$>...
> > > > >
> > > > > What about the profiler report? Can you post the profiler report for top 10 self-time for functions and how many times they are called?

> > > >
> > > > Hi Rakesh,
> > > > Here my profiler when i run two optimization processes, where testCM is m-file storing program of optimization, the object function in m-file is MydeformfuncSub7Ext, and in C mex file is MydeformfuncSub7ExtC.
> > > > Profiler of optimzation using m-file:
> > > >
> > > > Profiler of optimzation using C mexfile:
> > > >
> > > > As seen, subfunction LevenbergMarquardt consumes almost time of optimization process.
> > > > Is there any solution to reduce computation time for LevenbergMarquardt ?
> > > >
> > > > Toan

> > >
> > > Can you post some more images from clicking on the Profiler report for the LevenbergMarquardt.m function, and its slowest lines/function calls/etc? Maybe there is a way to speed it up.

> >
> > Hi Eric Sampson,
> > here is spending time of levenberg-marquardt function:
> >
> > I hope to receive some comments from you. Thank you.
> >
> > Toan

> The backslash operator (where ~99% of the time is spent) has some heuristics to analyze and decide what method (and pre-processing) to use for solving the equation. It is likely that in these two cases, the backslash operator thinks the matrix structure (probably symmetry) is different and ends up with a different and expensive step. This is just a guess without looking at the actual matrices.
> Rakesh

I agree with Rakesh. If you want to pursue this matter further, then what I would suggest is to put a debugging breakpoint on line 178 of the LM function, run the code with the original M file objective function and then with the MEX objective function, and in each case when it stops at the breakpoint save the AugJac and AugRes variables to a .mat file. Then create a support request at The Mathworks, include the two M files, and tell them to run 'tic, AugJac \ AugRes;, toc' with the contents of each .mat file and ask for their help in explaining the difference. Good luck!

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.