Speed of Fitting in Different Versions of SasView #2409
Replies: 2 comments
-
But what are the reasons for the difference in speed between the L-M optimizers? In the Developer thread @pkienzle suggests that the MPfit optimizer is making more function evaluations (which would make sense given that the time per evaluation is now shown to be ~same for both optimizers) and suggests a couple of reasons for why this might be:
|
Beta Was this translation helpful? Give feedback.
-
Also see SasView/sasmodels#518 |
Beta Was this translation helpful? Give feedback.
-
I thought it might be worthwhile to capture in a Discussion a recent thread from the Developers List.
INTRODUCTION
The thread started when I happened to ask an academic user of SasView why they were still using SasView 4.1.0 when we had released 6 versions of SasView 5.x. Their reply was:
The second part of that statement is, of course, good news. But the first part sufficiently intrigued me that I made some crude measurements and posted them to the Developers List. Responses advanced some plausible explanations (which we'll come to later) but @pkienzle also suggested a 'more refined' way to time my measurements. I've now had an opportunity to put that into practice.
PLATFORM
Dell desktop running W10 Enterprise (Build 19044)
Intel(R) Xeon(R) CPU E5-1630 v3 @ 3.70GHz, 3701 Mhz, 4 Core(s), 8 Logical Processor(s)
16Gb RAM
METHODOLOGY
Run a version of SasView
Load \test\1d_data\cyl_400_40.txt (NB: for the record, these data do not contain dQ information)
Send to Fitting
Select Cylinder : cylinder
Check scale, background, radius
(as required) Check Polydispersity and enter PD=0.1 for Distribution of radius
(as required) Check Distribution of radius
Choose an optimizer (Fitting > Fit Algorithms/Options)
Disable OpenCL (Fitting > GPU Options/OpenCL Options > No OpenCL)
(5.x only) Start the iPython Console (Tool > Python Shell/Editor) and paste in the following (with thanks to @pkienzle):
For everything else, use the SasView defaults!
Click Fit
When the fit has converged:
Close SasView
Rinse and repeat
RESULTS
The following SasView versions have been evaluated:
Key:
Fit Duration: No Polydispersity
Fit Duration: With Polydispersity but PD Fixed
Fit Duration: With Polydispersity and PD Optimising
Time per evaluation: No Polydispersity
Time per evaluation: With Polydispersity but PD Fixed
Time per evaluation: With Polydispersity and PD Optimising
DISCUSSION
On the face of it, the L-M optimizer in 4.2.2/5.0.3 is indeed faster than the L-M optimizer in 5.0.5. But of course they are not the same optimizer! SasView Users had pointed out that the L-M optimizer in 5.0.4 and earlier did not respect preset parameter bounds; ie, if you set min and max values for a parameter, say the radius, these would be ignored during the fitting! So for 5.0.5 the L-M optimizer used by SasView was changed from the one in SciPy to the MPfit one. But notice that the time per evaluation for both versions of the L-M optimizer are actually very similar for a given problem!
The rest of the timings are logical: more robust optimisers naturally take longer to converge, and fitting with polydispersity takes longer than fitting without polydispersity!
Perhaps the one surprise is that DREAM converged faster when the radius distribution was allowed to optimize compared to when it was not. But this is presumably a reflection of it just searching a more realistic parameter space?
Beta Was this translation helpful? Give feedback.
All reactions