-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A few tweaks needed in core/fitting.py #313
Comments
I took a quick look at changing >>> %timeit -n 1000 -r 7 fitter.fit() # with original /2
# 8.48 ms ± 31.7 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)
>>> %timeit -n 1000 -r 7 fitter.fit() # with new *0.5
# 8.54 ms ± 94.3 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each) |
Great, thanks for checking! |
I think in general using multiplies is a good choice, particular with 2 (0.5), but you probably need a lot of these cases for it to really make a significant difference. It also looks like numpy is probably not as sensitive to this (maybe they do some optimizations here):
Also googling this a bit, it looks like there might be also the issue with 0.5 not actually being exactly 0.5 in it's floating point representation, hence you introduce some additional floating point rounding errors. Not sure how that works with division by 2. It probably is all hardware dependent. I would use 0.5, but I feel it is a bit nitpicking. |
@cosama 0.5 should be exactly 0.5 in floating point |
While implementing the new model, I noticed a few things:
num
args ofConstantModel.guess()
andLineModel.guess()
are not usedexpgauss()
(in the same file) could be multiplies for potentially significant performance improvements (I would want to demonstrate this to be sure, though)I'll probably address these myself when I've got time
The text was updated successfully, but these errors were encountered: