twiecki/WhileMyMCMCGentlySamples

Syntax error in bayesian_neural_network.ipynb

alxempirical opened this issue · 4 comments

This line:

contour = ax.contourf(*grid, ppc['out'].mean(axis=0).reshape(100, 100), cmap=cmap)

Should be

X, Y = grid
contour = ax.contourf(X, Y, ppc['out'].mean(axis=0).reshape(100, 100), cmap=cmap)

Thanks, Alex. Both of those are python2 incompatibility issues. Will attempt to fix.

@twiecki I've also checked that in python 3 and had following error:

  File "<ipython-input-32-b55fe4d890f6>", line 3
    contour = ax.contourf(*grid, ppc['out'].std(axis=0).reshape(100, 100), cmap=cmap)
                                ^
SyntaxError: only named arguments may follow *expression

My Python3 3.4.3. Does this executes correctly on your configuration?

@alxempirical Thanks for this solution!

Maybe that's Python 3.5?

@pprzetacznik I updated the blog.