Changeset 7945367 in sasview for src/sas/fit
- Timestamp:
- Aug 21, 2015 6:17:40 PM (9 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 600bea1
- Parents:
- a342928
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/fit/BumpsFitting.py
re1442d4 r7945367 8 8 9 9 from bumps import fitters 10 try: 11 from bumps.options import FIT_CONFIG 12 # Default bumps to use the Levenberg-Marquardt optimizer 13 FIT_CONFIG.selected_id = fitters.LevenbergMarquardtFit.id 14 def get_fitter(): 15 return FIT_CONFIG.selected_fitter, FIT_CONFIG.selected_values 16 except: 17 # CRUFT: Bumps changed its handling of fit options around 0.7.5.6 18 # Default bumps to use the Levenberg-Marquardt optimizer 19 fitters.FIT_DEFAULT = 'lm' 20 def get_fitter(): 21 fitopts = fitters.FIT_OPTIONS[fitters.FIT_DEFAULT] 22 return fitopts.fitclass, fitopts.options.copy() 23 24 10 25 from bumps.mapper import SerialMapper, MPMapper 11 26 from bumps import parameter 12 13 # TODO: remove globals from interface to bumps options!14 # Default bumps to use the levenberg-marquardt optimizer15 27 from bumps.fitproblem import FitProblem 16 fitters.FIT_DEFAULT = 'lm' 28 17 29 18 30 from sas.fit.AbstractFitEngine import FitEngine … … 311 323 return False 312 324 313 fitopts = fitters.FIT_OPTIONS[fitters.FIT_DEFAULT] 314 fitclass = fitopts.fitclass 315 options = fitopts.options.copy() 316 max_step = fitopts.options.get('steps', 0) + fitopts.options.get('burn', 0) 325 fitclass, options = get_fitter() 326 steps = options.get('steps', 0) 327 if steps == 0: 328 pop = options.get('pop',0)*len(problem._parameters) 329 samples = options.get('samples', 0) 330 steps = (samples+pop-1)/pop if pop != 0 else samples 331 max_step = steps + options.get('burn', 0) 317 332 pars = [p.name for p in problem._parameters] 318 333 #x0 = numpy.asarray([p.value for p in problem._parameters])
Note: See TracChangeset
for help on using the changeset viewer.