twiecki / WhileMyMCMCGentlySamples

my blog
269 stars 204 forks source link

Cant run the Lasagne Example #6

Open afhuertass opened 6 years ago

afhuertass commented 6 years ago

Hi!

First of all i want to thank you for this material, I'm learning a lot from it, and kind falling in love with probabilistic programming :D

I have a problem running the Lasange example. when i try to run this part :

with pm.Model() as neural_network:
    likelihood = build_ann(GaussWeights())
    v_params, trace, ppc, y_pred = run_advi(likelihood)

It gives this error:

/usr/local/lib/python2.7/dist-packages/pymc3/variational/advi_minibatch.pyc in advi_minibatch(vars, start, model, n, n_mcsamples, minibatch_RVs, minibatch_tensors, minibatches, global_RVs, local_RVs, observed_RVs, encoder_params, total_size, optimizer, learning_rate, epsilon, random_seed, mode)
    476     if global_RVs is None:
    477         global_RVs = OrderedDict({v: 1 for v in grvs})
--> 478     _value_error(len(grvs) == len(global_RVs(),
    479                  'global_RVs ({}) must have all global RVs: {}'.format(
    480                      [v for v in global_RVs], grvs)

TypeError: 'OrderedDict' object is not callable

Any idea how can i fix it?

Thanks in advance

twiecki commented 6 years ago

The ADVI interface changed so I suggest trying to port it? Not sure when I get a chance to look into this. Are you running with PyMC3 3.2?

chenmoshushi commented 6 years ago

I also have the same problem.

twiecki commented 6 years ago

I'll look into it.

twiecki commented 6 years ago

I can't reproduce :-/