Speed improvement by changing convolution code #29
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There's two changes in this pull request.
The main change is that the convolution in the Tofts-Key Model is now performed using the algorithm detailed in the appendix of:
Flouri, Lesnic, & Sourbron (2016). MRM 76(3), doi: 10.1002/mrm.25991.
The new implementation provides a considerable improvement in speed without substantially changing the results - if anything, the errors are slightly smaller in noiseless QIBA 6 data.
At the bottom, I've included the summary statistics to compare the old version and the new convolution implementation.
The big change is the runtime which was calculated by running the fit 6 times, and then taking the mean +/- stdDev of the runtime from the last five fits - the first runtime is discarded because it is generally slower than the rest.
The second change is minor and involves commenting out one line which was causing
validate(6)
to fail. Commenting it out resolved the problem andvalidate(6)
now runs successfully for me on Julia 0.5.2.There is still a problem with
validate(4)
- I think it's the lines involving 'xticks' and maybe also 'yticks'.I'm not sure if this is a general problem or if it's just a problem on my end, so I didn't touch
validate(4)
.Comparison between Old and New convolution implementation
1. QIBA 6 - Noiseless
(1321 x 30 points on one CPU core)
2. QIBA 6 - Noisy
(1321 x 3000 points on one CPU core)
3. QIBA 4 - Noiseless
(661 x 90 points on one CPU core)