You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by ricardoV94 December 3, 2021
It seems that the difference is that LoosePointFunc allows you to evaluate a logp/dlogp/ what have you with args and kwargs, instead of just passing a dictionary, but at the cost of being slower because it has to wrap them in a dictionary (Point) before calling logp.
importpymcaspmwithpm.Model() asm:
x=pm.Normal('x')
y=pm.Normal('y', 0, 1, observed=0)
# Uses `LoosePointFunc` under the hoodm.logp({'x': 0})
m.logp(x=0)
m.logp([('x', 0)]) # Couldn't think of any other way of using `args`# Uses `FastPointFunc` under the hoodm.fastlogp({'x': 0})
m.fastlogp(x=0) # Failsm.fastlogp([('x', 0)]) # Fails
Since both attributes do the costly job of compiling a new logp function, we could also deprecate the fastlogp name and rename it to something like compile_logp, similar to compute_initial_point, which gives a better intuition that you should probably cache the output of this, and not call it in a loop for instance
The text was updated successfully, but these errors were encountered:
ricardoV94
changed the title
Deprecate LoosePointFunc and make FastPointFunc the default.
Deprecate LoosePointFunc and make FastPointFunc the default
Jan 7, 2022
Uh oh!
There was an error while loading. Please reload this page.
Discussed in #5237
Originally posted by ricardoV94 December 3, 2021
It seems that the difference is that
LoosePointFunc
allows you to evaluate alogp
/dlogp
/ what have you with args and kwargs, instead of just passing a dictionary, but at the cost of being slower because it has to wrap them in a dictionary (Point) before calling logp.pymc/pymc/model.py
Lines 1722 to 1766 in f6f1a8e
Since both attributes do the costly job of compiling a new logp function, we could also deprecate the
fastlogp
name and rename it to something likecompile_logp
, similar tocompute_initial_point
, which gives a better intuition that you should probably cache the output of this, and not call it in a loop for instanceThe text was updated successfully, but these errors were encountered: