-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Recursion problems in make_initial_point_expression
#5168
Comments
Can you try to compile the initial point function in |
It doesn't even get to compilation. The error is already in the creation of the expression. The model also involves a mask_RinRID # is a boolean numpy array
P_in_R # is a matrix random variable
P0 # is a vector pm.Data
P = at.empty(
shape=(190, 5),
dtype=aesara.config.floatX
)
P = at.set_subtensor(P[mask_RinRID, :], P_in_R)
P = at.set_subtensor(P[~mask_RinRID, :], P0[~mask_RinRID, None])
P = pm.Deterministic("P", P) Until yesterday I was running this model with PyMC |
By the way, can you also do prior predictive sampling? |
Yes, prior predictive sampling works just fine. |
Here's an example. with pm.Model() as pmodel:
one = pm.LogNormal("one", mu=0, sd=0.01)
two = pm.Lognormal("two", mu=one+0.1, sd=0.01)
three = pm.LogNormal("three", mu=two+0.1, sd=0.01) The problematic cases are characterized by a nonsensical recursion in the first element of the resulting initial values graph: ipx = pm.initial_point.make_initial_point_expression(
free_rvs=pmodel.free_RVs,
rvs_to_values=pmodel.rvs_to_values,
initval_strategies=pmodel.initial_values,
jitter_rvs={},
default_strategy="prior",
return_transformed=False,
)
aesara.dprint(ipx)
ipx[0].eval() # RecursionError Traceback
(updated with the findings @ricardoV94 and I got so far) |
@aseyboldt we tried different things without luck so far. Can you help us look into this? |
MemoryError
in make_initial_point_expression
make_initial_point_expression
Description of your problem
I have a rather big model that's taking ages to compile the initial point function, eventually running into a
MemoryError
after ~45 minutes.The model involes a latent GP and lots of subindexing.
UPDATE: It happens also without the GP.
Please provide a minimal, self-contained, and reproducible example.
#5168 (comment)
Please provide the full traceback.
Complete error traceback
Please provide any additional information below.
Interestingly I can do
.eval()
on the likelihoods in the model just fine.Any ideas?
Versions and main components
main
The text was updated successfully, but these errors were encountered: