-
Notifications
You must be signed in to change notification settings - Fork 70
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
Change behaviour of dtype on equivalent sources #516
base: main
Are you sure you want to change the base?
Conversation
Apply `dtype` argument only to the jacobian matrix and the predictions for equivalent sources. Don't use the `dtype` for casting coordinates and location of the sources.
Hi @santisoler, I'm curious about why this is needed. |
Hi @leouieda. I didn't quite like that the docstring for I fixed that issue in #514 by converting the coordinates of the sources, but it sounded wrong: we were using |
As long as the Jacobian and predictions are still in the correct dtype then it makes sense. Otherwise, it would be better to fix the docs, right? |
I think I'd prefer to keep things simple. The main reason to include the And now that I think about it, since we don't use the Jacobian to make predictions, once the coefficients are fit, we can just return predictions as float64. Is there any sense to keep the predictions as float32 as well? |
I'm not sure. I suppose I thought of the dtype being for the model so then predictions would also be float32. I guess having the dtype impact only the jacobian and not the output of the class feels wrong. |
Update code, docstrings and tests.
Make use of the
dtype
argument in equivalent sources only to build the jacobian matrix. Stop using thedtype
for casting predictions, coordinates and location of the sources. Predicted arrays will by float64, while coordinates and location of the sources will have the same types as the original arguments.