Ticket #9531 (closed: fixed)

Opened 6 years ago

Last modified 5 years ago

Add a DomainCreator that creates a SeqDomain corresponding to a Workspace2D

Reported by: Michael Wedel Owned by: Michael Wedel
Priority: major Milestone: Release 3.2
Component: Framework Keywords: CurveFitting
Cc: roman.tolchenov@… Blocked By:
Blocking: Tester: Roman Tolchenov

Description

In POLDI fits (with the MultiDomainFunction approach described in #9445) the Jacobians get very large (several million elements), so the fit becomes very slow. To avoid this behavior, a SeqDomain with one FunctionDomain1DSpectrum per spectrum of the original workspace will be used instead. That way it is possible to utilize LevenbergMarquardMDMinimizer, which splits up the matrices into smaller chunks.

For this to work, a DomainCreator is required that produces the correct domain. This domain could be used in any case where several spectra of one workspace need to be fitted simultaneously.

Attachments

Artificial.nxs (1.4 MB) - added by Michael Wedel 6 years ago.
Workspace that contains appropriate data for SeqDomainDemonstration

Change History

comment:1 Changed 6 years ago by Nick Draper

  • Status changed from new to assigned

comment:2 Changed 6 years ago by Michael Wedel

  • Status changed from assigned to inprogress

Refs #9531. Added ComainCreator for FunctionDomain1DSpectrum.

Changeset: ea35aeaa7335ff6586df3bab1c5537e30807408b

comment:3 Changed 6 years ago by Michael Wedel

Refs #9531. Added SeqDomainSpectrumCreator with test.

Changeset: 9a354d79bac4cfe6c787015c7ab92ef4f1bde9c9

comment:4 Changed 6 years ago by Michael Wedel

Refs #9531. Setting fit values in FunctionDomain1DSpectrumCreator.

Changeset: 63331392800123a3ab482cc6f6bc5730512085af

comment:5 Changed 6 years ago by Michael Wedel

Refs #9531. Added fitting tests.

Changeset: c782c3d52c98c3e80db729147c204de4ad6b03f0

comment:6 Changed 6 years ago by Michael Wedel

Refs #9531. Adjusted Fit to make tests work.

Changeset: c90913032daf8754b7e0214dd8a24aded9ad2bac

comment:7 Changed 6 years ago by Michael Wedel

Refs #9531. Added test function for SeqDomainSpectrumCreator.

Changeset: 52bf34e0792517491ee828348ca0885ffe7617b7

comment:8 Changed 6 years ago by Michael Wedel

Refs #9531. Added demonstration algorithm.

The algorithms fits the test function to the provided workspace data. Useful for profiling "real world data" with appropriate dimensions (data and parameters).

Changeset: 46747ba1729333ba21b155c73cffecd5e15fab1b

Changed 6 years ago by Michael Wedel

Workspace that contains appropriate data for SeqDomainDemonstration

comment:9 Changed 6 years ago by Michael Wedel

The attached data can be fitted with this minimal script, given "Artificial.nxs" (see attachment) is in a location where Mantid can find it:

ws = Load("Artificial.nxs")
SeqDomainDemonstration(ws)

I recommend setting Log Level to something like "Notice", since "Debug" prints out a lot of information.

comment:10 Changed 6 years ago by Michael Wedel

Refs #9531. Mapping fit weights in CostFuncFitting.

Instead of calling the virtual function getWeights each time fit weights are accessed in LeastSquaresCostFunc, they are mapped once before the calculations.

Changeset: eb67fc50f6268afc73f8f1c716d6825f75b8e9f9

comment:11 Changed 6 years ago by Michael Wedel

Refs #9531. Further reduced number of virtual function calls.

Followed Roman's suggestion to make getFitWeights() virtual and remove getWeight as well as calSqrtW from CostFuncLeastSquares.

Changeset: 0d069366649fea2d7e6782da0ce11f3757dd70a3

comment:12 Changed 6 years ago by Michael Wedel

Refs #9531. Added documentation to domain creators.

Changeset: 9417ba838adfb3daf772c7b3395a8233ac65d19b

comment:13 Changed 6 years ago by Michael Wedel

Refs #9531. Added check for SeqDomainSpectrumCreator in Fit.

Changeset: a48f056310e4e1daf786f34b4f2072d47ad76a27

comment:14 Changed 6 years ago by Michael Wedel

Refs #9531. Cleaned up SeqDomanSpectrumCreatorTest.

Changeset: b065d2015350b6bfd6b9d7327d482038535bc490

comment:15 Changed 6 years ago by Michael Wedel

Refs #9531. Removed test function and demonstration algorithm.

This is already in the unit tests now and SeqDomainTestFunction and SeqDomainDemonstration don't do anything useful.

Changeset: f82833287a1139e12fa4e37214bba54893dad6ea

comment:16 Changed 6 years ago by Michael Wedel

Refs #9531. Fixed doxygen warning.

Changeset: 703807bdeeb9b69d6ad42168e4e74a363d2b2f95

comment:17 Changed 6 years ago by Michael Wedel

Refs #9531. Created IFunction1DSpectrum interface.

IFunction1DSpectrum is an interface roughly equivalent to IFunction1D, with the exception that it must use FunctionDomain1DSpectrum.

Changeset: 200427bf34dfdbb9f66a6b31966272da8bfc9ded

comment:18 Changed 6 years ago by Michael Wedel

Refs #9531. Integrated IFunction1DSpectrum into Fit and tests

Instead of having an extra property, fit now checks if the fit function can be cast to IFunction1DSpectrum to assign the correct domain creator.

Changeset: 2e15ad4e5c58c6678e8e58ad610f09cb080d745f

comment:19 Changed 6 years ago by Michael Wedel

  • Owner set to Michael Wedel
  • Status changed from inprogress to verify
  • Resolution set to fixed

Testing of the new DomainCreators is mostly handled by the unit tests. SeqDomainSpectrumCreator has two tests that fit functions to artificial data (one with 1 parameter and one with 40 parameters).

The changes to CostFuncLeastSquares exclusively improve performance. Without the modifications the fit takes much more time once there are many data points/parameters involved.

comment:20 Changed 6 years ago by Roman Tolchenov

Re #9531. A couple of corrections to make Fit work

Changeset: 04b4d504ad8b48f0107daa534197186996caeee4

comment:21 Changed 6 years ago by Michael Wedel

Refs #9531. Modified unit test of SeqDomainSpectrumCreator

The unit test now instantiates Fit via the AlgorithmManager.

Changeset: 09046f2ad4ab6d37c9f182dcb5bb91fac58c0302

comment:22 Changed 6 years ago by Roman Tolchenov

  • Status changed from verify to verifying
  • Tester set to Roman Tolchenov

comment:23 Changed 6 years ago by Roman Tolchenov

  • Status changed from verifying to closed

Merge remote-tracking branch 'origin/feature/9531_SpectrumSeqDomainCreator'

Full changeset: 5fc85d94192b306b9c38fe4025ecebfa4d5a5757

comment:24 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 10374

Note: See TracTickets for help on using tickets.