Closed sachinruk closed 8 years ago
The expected minibatches parameter now expects a generator of iterables instead of the iterable of generators the tutorial provides. Could you try and change the create_minibatch function and minibatches variable to:
def create_minibatch(data):
rng = np.random.RandomState(0)
while True:
ixs = rng.randint(len(data), size=50)
yield data[ixs]
minibatches = zip(
create_minibatch(X_train),
create_minibatch(Y_train),
)
that did the trick!
Hi all,
I am trying to run the code in http://pymc-devs.github.io/pymc3/notebooks/bayesian_neural_network_advi.html . However, I am running into the error:
TypeError: 'list' object is not an iterator
when I run the block:Thomas suggested that it may be because I am running a legacy version of Python (as shown in the comments in: http://twiecki.github.io/blog/2016/06/01/bayesian-deep-learning/#comment-2752623456). However, I am running the anacondas Python 3.5 version. Normal VB using
v_params = pm.variational.advi(n=50000)
works perfectly fine.The full error is posted below:
Note 1. Just so you know I do not have an
izip
function in itertools as was suggested by Tom in his blog comments.Any thoughts? Thank in advance.