How do I install theano in Anaconda ver. 2.1 Windows 64 bit for Python 3.4?

Running Theano on Python 3.4 is complicated. So far I would recommend that you run Theano in Python 2.7. The libraries written for Theano are Python 2.6+ based. So in order to get Theano running in Python 3.4, you would be needing the 2to3 automated python 2 to 3 code translation tool. I haven’t tested … Read more

Keras: “RuntimeError: Failed to import pydot.” after installing graphviz and pydot

The error message is a bit misleading, as you can see here. The problem is that graphviz is not installed. But you mention that graphviz was installed using pip. This is also misleading, since that graphviz package is just a python wrapper, and the graphviz binaries have to be installed separately for the python wrapper … Read more

How do I install Keras and Theano in Anaconda Python on Windows?

It is my solution for the same problem Install TDM GCC x64. Install Anaconda x64. Open the Anaconda prompt Run conda update conda Run conda update –all Run conda install mingw libpython Install the latest version of Theano, pip install git+git://github.com/Theano/Theano.git Run pip install git+git://github.com/fchollet/keras.git

NaN loss when training regression network

Regression with neural networks is hard to get working because the output is unbounded, so you are especially prone to the exploding gradients problem (the likely cause of the nans). Historically, one key solution to exploding gradients was to reduce the learning rate, but with the advent of per-parameter adaptive learning rate algorithms like Adam, … Read more

Getting gradient of model output w.r.t weights using Keras

To get the gradients of model output with respect to weights using Keras you have to use the Keras backend module. I created this simple example to illustrate exactly what to do: from keras.models import Sequential from keras.layers import Dense, Activation from keras import backend as k model = Sequential() model.add(Dense(12, input_dim=8, init=”uniform”, activation=’relu’)) model.add(Dense(8, … Read more

How to get reproducible results in keras

You can find the answer at the Keras docs: https://keras.io/getting-started/faq/#how-can-i-obtain-reproducible-results-using-keras-during-development. In short, to be absolutely sure that you will get reproducible results with your python script on one computer’s/laptop’s CPU then you will have to do the following: Set the PYTHONHASHSEED environment variable at a fixed value Set the python built-in pseudo-random generator at a … Read more