I have a problem that has been totally eating me up all day. I believe there is a simple solution to the question…
If I specify a theano shared variable for use in a pymc3 model so that i can loop without re-specifying the model, it seems the initial value of the shared variable effects the result. If the initial value is too far from the new value, I get a “The derivative of RV
test1.ravel() is zero.” error. Why is this??
See my code below. changing the nf value to 10 or change the new value to 100000 would fix the error…
nf = 10000000000000000000 sharednf = shared(nf) with pm.Model() as model: test = pm.Normal("test"+str(1), mu=sharednf, sd=1**100) sum = test + 1 pm.Deterministic("sum"+str(1), sum) for i in range(10): sharednf.set_value(float(1)) with model: trace = pm.sample(5000) trace1 = trace print(pm.summary(trace)) pm.traceplot(trace) plt.show()