gpufit / Gpufit

GPU-accelerated Levenberg-Marquardt curve fitting in CUDA
MIT License
312 stars 92 forks source link

Framework to numerically check supplied derivatives #28

Open jkfindeisen opened 6 years ago

jkfindeisen commented 6 years ago

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.

mscipio commented 6 years ago

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

superchromix commented 6 years ago

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

ironictoo commented 5 years ago

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.

jkfindeisen commented 3 years ago

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