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

Functional samples #243

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Functional samples #243

wants to merge 4 commits into from

Conversation

wiseodd
Copy link
Collaborator

@wiseodd wiseodd commented Sep 14, 2024

Closes #241.

Use case: computation of an arbitrary expectation w.r.t. $p(f(x) \mid x, \mathcal{D})$.

@wiseodd wiseodd added the enhancement New feature or request label Sep 14, 2024
@wiseodd wiseodd self-assigned this Sep 14, 2024
Copy link
Collaborator

@runame runame left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This solution is nice because it is really flexible. I guess one small potential downside is that in this case you can't use __call__ with another link function. Maybe this is even a good thing since using functional_samples is a lot more explicit than yet another argument to __call__.

laplace/baselaplace.py Show resolved Hide resolved
@wiseodd
Copy link
Collaborator Author

wiseodd commented Sep 15, 2024

I guess one small potential downside is that in this case you can't use call with another link function. Maybe this is even a good thing since using functional_samples is a lot more explicit than yet another argument to call

I agree with your last statement.

I believe the original semantic for __call__ is "making predictions based on the posterior obtained via __fit__". So, I'd say having an option in __call__ to do an arbitrary expectation is ill-suited. Esp. so since we don't support an arbitrary loss function for computing the Hessian.

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

Successfully merging this pull request may close these issues.

Feature Request: Allow sampling of log probs and logits for Likelihood.CLASSIFICATION
2 participants