tkanmae / levmar

Python binding to the levmar library using Cython
Other
19 stars 9 forks source link

Crashes if funcs returns a float32 arrays, #3

Open Tillsten opened 14 years ago

Tillsten commented 14 years ago

See Title, the easy solution would be a check of the output of f and, if neccersy, upcast it to float64. The better solution would be using the single precession parts of levmar, mostly because the estimation of the jacobian takes too small steps for a single producing func. I have to use single precission because i use cuda for calculating my fitting function,

tkanmae commented 14 years ago

I could not reproduce the problem using a Gaussian returning a float32 array. It would be helpful if you can give me some information as the followings::

* Did you provide an analytic Jacobian as well?
* What constraints did you used? or What fitting function in the levmar library was used with your constraints?
* It will be helpful if you can give me a code snippet that reproduce the crash. 
Tillsten commented 14 years ago

First of all, thanks for you great work. Levmar seems to be faster then scipy.leastsq.

  1. No, i did not.
  2. No constrains were given.
  3. I will try to get a working code sample ready, could take a day.
Tillsten commented 14 years ago

Sorry for the Delay, the problem is more mysterious then i taught. You are right, simply return a float32 does nothing. But without a float64 conversion, the program crashes sometimes. Maybe it has problems with the subnormal numbers CUDA can return. I am quite busy at the moment, but if i have more free time, ill get back to the issue.