Skip to content
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

Optionally skip returning the variance #48

Open
MatthieuSchaller opened this issue Aug 8, 2024 · 2 comments
Open

Optionally skip returning the variance #48

MatthieuSchaller opened this issue Aug 8, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@MatthieuSchaller
Copy link
Member

Could we add an optional parameter to GaussianProcessEmulator.predict_values() which would switch on/off the computation of the variance? That would "just" require to pass return_var=False to the george GP object.

In my use case, returning the variance is 50x slower (60ms vs. 1.2ms) than not returning it. In an emulation MCMC scenario where the PS baryon ratio is just a small component, that is a critical difference.

Getting the full error is only necessary once the chain has converged and then switching on the variance return would suffice.

Happy to have a stab at it.

@MatthieuSchaller MatthieuSchaller added the enhancement New feature or request label Aug 8, 2024
@JBorrow
Copy link
Member

JBorrow commented Aug 9, 2024

I don't like overloading the return values of a function based on an input parameter. But i am more than happy for you to write a predict_values_no_error() or similarly named function. You would need to add it to the abstract base class in base.py and then add corresponding versions to all of the associated classes in emulators/. It shouldn't be too bad.

@MatthieuSchaller
Copy link
Member Author

Ok. I agree that having different numbers of outputs based on arguments is not great but seems common in the python world.

A separate function will work too. I'll do that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants