I have been trying to get this one thing going for two days and read a lot of documentation. I am missing something very basic. I have a loop which I implement using theano.scan. It involves feeding an index i, which I want to start at 0. In the loop body I have a statement
day_prob_slice = prob_v[0, i, 0]
which appears fine by itself. However, by the time i gets to this statement, i got transformed into 0.0, a float or double, and the code bombs with TypeError: Expected an integer
I tried
x = 0
i = tt.as_tensor_variable(x, “loop_index”)
but, I don’t know how to force it to an integer
also
i = tt.lscalar('loop_index')
but, then I don’t know how to set its value, and it fails with
ValueError: Cannot compute test value: input 0 (loop_index) of Op Elemwise{Cast{float64}}(loop_index) missing default value.
The entry into the loop is
pm.DensityDist('lh', logp, observed={'i': i, 'visits': Y, 'x_logits' : N_x_logit, 'mu':mu})
Please give a clue how to do this.