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
{{ message }}
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.
When I try to sample, I'm seeing odd indexing errors as NUTS initializes. Here is my code:
with pm.Model() as model:
# Set prior distributions.
k = pm.Lognormal("k", mu=np.log(2), sigma=4, shape=(1,)) # Collision frequency
A = pm.Lognormal("A", mu=np.log(9800.), sigma=1000, shape=(1,)) # Pre-exponential factor (rate)
B = pm.Lognormal("B", mu=np.log(320.), sigma=100, shape=(1,)) # Proportionality Coefficient/Activation Energy
C = pm.Lognormal("C", mu=np.log(1.5/10000), sigma=1/10000, shape=(1,)) # Scaled Heat Transfer Coefficient
Cs = pm.Lognormal("Cs", mu=np.log(3.5), sigma=3, shape=(1,)) # Fuel Relative Disappearance Rate
# Run the model.
T_preds = theano_fem_solver(k, A, B, C, Cs)
# Transform temperature to probabilities.
probs = tt.nnet.sigmoid((T_preds-500)/50)
# Calculate the likelihood.
like = pm.Bernoulli('likelihood', p=probs, observed=obs)
# MCMC
trace = pm.sample(tune=2, draws=2, chains=1, cores=1, return_inferencedata=False)
Here, the traceback ends with an index error in this package during NUTS initialization:
File ~/miniconda3/envs/fenics_new/lib/python3.8/site-packages/theano/graph/op.py:130, in compute_test_value(node)
127 thunk.inputs = [storage_map[v] for v in node.inputs]
128 thunk.outputs = [storage_map[v] for v in node.outputs]
--> 130 required = thunk()
131 assert not required # We provided all inputs
133 for output in node.outputs:
134 # Check that the output has been computed
File ~/miniconda3/envs/fenics_new/lib/python3.8/site-packages/theano/graph/op.py:491, in Op.make_py_thunk..rval(p, i, o, n, params)
484 def rval(
485 p=p,
486 i=node_input_storage,
(...)
489 params=params_val,
490 ):
--> 491 r = p(n, [x[0] for x in i], o, params)
492 for o in node.outputs:
493 compute_map[o][0] = True
File ~/.local/lib/python3.8/site-packages/fenics_pymc3/core.py:50, in FenicsVJPOp.perform(self, node, inputs, outputs, params)
41 numpy_grads = evaluate_pullback(
42 fenics_output, fenics_inputs, tape, Δfenics_output
43 )
45 theano_grads = (
46 theano.gradient.grad_undefined(self, i, inputs[i]) if ng is None else ng
47 for i, ng in enumerate(numpy_grads)
48 )
---> 50 for i, tg in enumerate(theano_grads):
51 outputs[i][0] = tg
File ~/.local/lib/python3.8/site-packages/fenics_pymc3/core.py:46, in (.0)
40 fenics_output, fenics_inputs, tape = params
41 numpy_grads = evaluate_pullback(
42 fenics_output, fenics_inputs, tape, Δfenics_output
43 )
45 theano_grads = (
---> 46 theano.gradient.grad_undefined(self, i, inputs[i]) if ng is None else ng
47 for i, ng in enumerate(numpy_grads)
48 )
50 for i, tg in enumerate(theano_grads):
51 outputs[i][0] = tg
IndexError: list index out of range
Am I missing something here? Or is there an issue with the latest version of pymc3? I'd appreciate any help in resolving or understanding this.
The text was updated successfully, but these errors were encountered:
It seems I have pinned all the dependencies already in #8.
I'm sorry a lot has changed in PyMC. Yet another fork of Theano (https://www.pymc.io/blog/pytensor_announcement.html) doesn't look promising for a curious outsider to the world of PyMC like me. I'm afraid I won't be able to find the time to revive and update this demo to modern PyMC.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When I try to sample, I'm seeing odd indexing errors as NUTS initializes. Here is my code:
Here, the traceback ends with an index error in this package during NUTS initialization:
Am I missing something here? Or is there an issue with the latest version of pymc3? I'd appreciate any help in resolving or understanding this.
The text was updated successfully, but these errors were encountered: