Gpufit icon indicating copy to clipboard operation
Gpufit copied to clipboard

Framework to numerically check supplied derivatives

Open jkfindeisen opened this issue 8 years ago • 4 comments

That is standard in many other packages and also quite useful to check models. It also would allow to use models without an analytical derivative at the cost of performance and maybe numerical accuracy.

jkfindeisen avatar Nov 22 '17 13:11 jkfindeisen

That would make easier to add more complex models. I am not so familiar with C++ libraries, was this just a todo/reminder, or do you have any idea/examples of how to do it?

Also this somehow link to issue #27

mscipio avatar Nov 22 '17 15:11 mscipio

This is a reminder for a future improvement to the library.

superchromix avatar Nov 26 '17 14:11 superchromix

I have implemented a numerical differentiation that worked well for me, I have created an example file here: Numerical Differentiation I tested it against an analytical derivative for this model (Tofts exchange model) and it had nearly identical performance and accuracy. Due the the multiple value evaluations required I created a helper function get_value() to make the code a little cleaner. This could be added to the main project as an example giving people an easy option to add numerical derivative if they chose. The proposed solution can be added on a model by model basis which is convenient. I'm happy to help with integration.

ironictoo avatar Sep 03 '19 18:09 ironictoo

See also https://github.com/gpufit/Gpufit/pull/92

jkfindeisen avatar Aug 31 '21 12:08 jkfindeisen