blei-lab / edward

A probabilistic programming language in TensorFlow. Deep generative models, variational inference.
http://edwardlib.org
Other
4.83k stars 760 forks source link

Example with Keras would be nice #124

Closed TJKlein closed 8 years ago

TJKlein commented 8 years ago

Hi there,

there is a bunch of cool examples. However, I am missing an example with Keras. It would be great to have one. I wanted to create a bayesian NN using defining the network architecture using Keras....

Cheers

dustinvtran commented 8 years ago

hi @TJKlein. there's a mixture density network example available here with an excellent notebook written by @cbonnett associated with it. It uses Keras for constructing the network architecture in the model.

Unfortunately it's not possible to be Bayesian about network architectures defined in higher-level languages. This is because they don't provide access to the weights: they are stored and accessed internally in the language. To put priors on weights (as in Bayesian NN's), we have to specify them manually as in the current Bayesian NN example.

TJKlein commented 8 years ago

Thanks for the quick reply. That's too bad. I saw this PyMC3 example using Lasagne in combination with PyMC3 and was hoping for similar things using Keras :).

dustinvtran commented 8 years ago

Yeah we could definitely do it with Lasagne as they allow the weights as input. Perhaps that would be a useful middleground between manually specifying the NN architecture and using Keras to do everything.

nbro commented 5 years ago

@dustinvtran The example you mentioned above does not exist anymore (dead link). Can you update the link?