-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
[WIP] logp-caching in Metropolis #2882
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
Conversation
Yeah that is more or less I would do it: ie, evaluate |
This looks like a good idea, but maybe increases the complexity of the code a bit. I have a two suggestions below for making it less "ad hoc", though a third option is to add a comment above the code block, preferably with a reference.
Also: The |
That's what I thought as well, as it should be optimized as if it only evaluates the logp once. But if the optimization does not work (e.g., calling an outside function), caching should indeed improve the speed. |
The If one compares the performance of once However, I think there might be a problem with component sampling. |
The |
I'm closing this for now - see #2881 for the reason |
#2881
I'm experimenting with caching the
logp(q)
from one iteration to the next.There're probably better ways to do the following two things:
fastlogp
?)A notebook that demonstrates the effect of caching on sampling noisy target densities:
https://gist.github.com/michaelosthege/656215deb662b23b6bcaa1f4d6f24758