Quantum Bayesian Networks

February 9, 2018

Today Enrolled our Baby (Quantum Fog) in gambling school taught by famous Monte Carlo gamblers (PyMC3, Edward, Zhusuan)

Filed under: Uncategorized — rrtucci @ 4:57 am

In the beginning, there was Matlab, which grew out of the Fortran lib Lapack (Linear Algebra Package, still one of the main software libs used to benchmark supercomputers). Matlab’s tensor stuff was copied and improved by the Python borgs to produce numpy, which handles tensors really nicely but doesn’t do it in a distributed “parallel” fashion. Then, starting about 10 years ago, some guys from the University of MontrĂ©al had the brilliant idea of writing the Theano Python Library (Theano was a Greek mathematician thought to have been the wife of Pythagoras). Theano replaces most numpy functions with Theano functions that are namesakes of the numpy ones and do the same thing in a distributed fashion. Then Google came out with the TensorFlow Python Lib, which copied Theano and improved on it. TensorFlow can do most numpy operations using multiple CPUs, GPUs and TPUs. But TensorFlow and Theano are much more than tools for doing tensor operations in a distributed fashion. They also do differentiation in a distributed fashion (such differentiation is often used to train neural nets). They are also designed to help you do fast prototyping and distributed running of artificial neural nets. In the last year, some new Python libraries built on top of TensorFlow and Theano have appeared that allow you to do fast prototyping and distributed running of Bayesian networks. B nets are dear and near to my heart and I consider them even more powerful than artificial neural networks. And I’m far from being alone in my love of b nets. Judea Pearl won the prestigious Turing prize for his pioneering work on them. Those new Python libs that I alluded to are PyMC3 (built on top of Theano), Edward (on top of TensorFlow) and Zhusuan (on top of TensorFlow). Added later: Forgot to mention that Facebook & Uber have their own Theano equivalent called PyTorch and also an Edward equivalent called Pyro. But I haven’t used them yet.

The main architect of Edward is Dustin Tran, who wrote Edward as part of his PhD thesis at Columbia Univ. Dustin now works at Google, and the TensorFlow team is working with Dustin to integrate Edward with TensorFlow.

Zhusuan is the art of using an abacus. The word means literally “bead counting” in Chinese. The Zhusuan lib is a fine open-source (under MIT license) product of the Tsinghua University in Beijing, China. It demonstrates that China is already very advanced in AI.

According to Google Trends, “TensorFlow” is at least 10 times more popular than “quantum computing” as a search term, even though TensorFlow has many competitors that started before it did and it was open sourced for the first time only 2 years ago.

One of the aims of artiste-qb.net is to participate in the revolution of extending Edward & Tensorflow so that it can do both classical and quantum Bayesian Networks. Today we took a small, initial step in that direction. We added a folder


which contains a file called ModelMaker.py and two jupyter notebooks. Both notebooks do MCMC for the classical Bayesian network WetGrass. One notebook does this by invoking the external software PyMC (a.k.a. PyMC2, the precursor of PyMC3), whereas the other does it via PyMC3. Both notebooks start by loading a .bif file for the WetGrass bnet. From that alone, they construct an X native model and analyze that model using X, where X = PyMC2, PyMC3. In the near future, we will also add a notebook that does the same thing for X=Edward, Zhusuan.
Addendum(Feb.16, 2018): Added support for Edward

climbing-mt-qc(Image by Henning Dekant)


Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: