Ticket #7476 (closed: fixed)

Opened 7 years ago

Last modified 5 years ago

Implement Rwp cost function

Reported by: Peter Peterson Owned by: Wenduo Zhou
Priority: major Milestone: Release 3.0
Component: Framework Keywords:
Cc: Blocked By:
Blocking: Tester: Vickie Lynch

Description

Since this is used in the LeBail fitting add it as a proper cost function. Look at CostFunctionLeastSquares for more guidance, but basically you need to inherit from CostFuncFitting and add a DECLARE_COSTFUNCTION and it will be in the list of available cost functions in the Fit algorithm.

Attachments

verify7476.py (698 bytes) - added by Wenduo Zhou 7 years ago.

Change History

comment:1 Changed 7 years ago by Nick Draper

  • Milestone changed from Release 2.7 to Backlog

comment:2 Changed 7 years ago by Wenduo Zhou

  • Milestone changed from Backlog to Release 3.0

comment:3 Changed 7 years ago by Wenduo Zhou

  • Status changed from new to inprogress

Started the implementation of Rwp cost function. Refs #7476.

Changeset: 005cb06571b09507e9b0dad48ee2a0be22cf08e6

comment:4 Changed 7 years ago by Wenduo Zhou

Checkpointing work. Refs #7476.

Changeset: bfd75beaa4c1f4061fac2debed62d20d9e11e1d7

comment:5 Changed 7 years ago by Wenduo Zhou

Checkpointing work. Refs #7476.

Implemented the Hessian matrix and Derivative vector. It works with non-Levenberg-Marquadt minimzers. The result looks fine.

Changeset: 651d041fce858cad8e011cee180a31e5d49869ba

comment:6 Changed 7 years ago by Wenduo Zhou

Modifed to be inherited. Refs #7476.

Modify CostFuncLeastSquare such that CostFuncRwp can inherit from it.

Changeset: 2c9ea77510497fb0d70caeb2642391cb7dc7813f

comment:7 Changed 7 years ago by Wenduo Zhou

Changed inheritance. Refs #7476.

Made CostFuncRwp inherit from CostFuncLeastSquares other than CostFuncFitting.

Changeset: 80a49dae2a49e0f338040a002bd6c1a7dd0c936a

comment:8 Changed 7 years ago by Wenduo Zhou

Added some unit tests related. Refs #7476.

Changeset: 5c05336ed6a84ddc2353f0d69d3a47605476f692

comment:9 Changed 7 years ago by Wenduo Zhou

Added class variable for cost function factor. Refs #7476.

Changeset: f375cf10731c17b058b771ff462b32681c03a656

comment:10 Changed 7 years ago by Wenduo Zhou

Added 1 more row in Fit's output table. Refs #7476.

Changeset: d0f345885dff2879ed72b77e8a9387dd02f01cf0

comment:11 Changed 7 years ago by Wenduo Zhou

For testers

Cost function Rwp works well with minimizer Levenberg-MarsquardtMD. It can selected from the Fit interface.

Here is a test to check the value:

  1. Download the script attached to generate a simple workspace 'Temp'.
  2. Launch 'Fit' interface and fit it with 'ExpDecay'.
  3. Set Height to 19. and LifeTime to 0.1. Do evaluation (other than fit). You can find Rwp equal to 6.52 in the parameter table workspace.
  4. Do a fit to check whether Rwp works with fitting.

Changed 7 years ago by Wenduo Zhou

comment:12 Changed 7 years ago by Wenduo Zhou

Removed the 4th line in output table. Refs #7476.

Changeset: 0f1c1ab926c8c950a812628918972ac93f2c1042

comment:13 Changed 7 years ago by Wenduo Zhou

Commented out debug output. Refs #7476.

Changeset: 16aab4a06c69d99e03d2bcec7e088dbb0410e43b

comment:14 Changed 7 years ago by Wenduo Zhou

Fixed unit test. Refs #7476.

Changeset: 5b161db5878ad3addd64ff96e5e55b8b12d837b1

comment:15 Changed 7 years ago by Wenduo Zhou

  • Status changed from inprogress to verify
  • Resolution set to fixed

comment:16 Changed 7 years ago by Russell Taylor

Changes in either this ticket or #8056 slowed SystemTests.CalibrateRectangularDetector_Test.PG3Calibration by about 40%. These are the changes that triggered this.

comment:17 Changed 7 years ago by Russell Taylor

  • Status changed from verify to reopened
  • Resolution fixed deleted

It looks to be this one that slowed the system test down. This needs understanding, or an agreement that it doesn't matter/is necessary.

Also, the code needs cleaning of #if 1/0 entries & debug prints.

comment:18 Changed 7 years ago by Wenduo Zhou

  • Status changed from reopened to inprogress

comment:19 Changed 7 years ago by Wenduo Zhou

Cleaned the code. Refs #7476.

Changeset: aabdcaa7ea9a851af23f8101d2532c9f1f6c4a5c

comment:20 Changed 7 years ago by Wenduo Zhou

Cleaned the code. Refs #7476.

Changeset: a6fe29bf1ef722462faf7d4ef5c47ec28ac2e2c3

comment:21 Changed 7 years ago by Wenduo Zhou

  • Status changed from inprogress to verify
  • Resolution set to fixed

The codes have been cleaned.

The slow down in the system test may not be caused by change in CostFuncLeastSquare, as there was some other algorithms related that were changed. And by comparing the original codes and the modified one, I could not see any change that can cause a significant slowdown.

comment:22 Changed 7 years ago by Vickie Lynch

  • Status changed from verify to verifying
  • Tester set to Vickie Lynch

comment:23 Changed 7 years ago by Vickie Lynch

  • Status changed from verifying to closed

Merge remote branch 'origin/feature/7476_new_costfun_rwp'

Full changeset: 7b82e2cbd91c7517ced895c73863931dcfa1a70a

comment:24 Changed 7 years ago by Russell Taylor

The CalibrateRectangularDetector_Test.PG3Calibration system test has consistently been taking 50% longer that it previously did since this was merged to master. It's pretty clear that these changes are the source of the slowdown.

comment:25 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 8321

Note: See TracTickets for help on using tickets.