Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
77 lines (63 sloc) 3.38 KB


Keras is a python library for neural networks and provides a high-level inteface to Theano or Tensorflow libraries. The examples in this github repository assume that you are familiar with the theory of the neural networks. To learn more about the neural networks, you can refer the resources below.

Installation Instructions

Installation instructions for Keras (includes links to Theano and Tensorflow installaion):

To Use GPU, install CUDA:

To resolve common installation issues, refer the README on Laura Graesser's Github repository.

Using Tensorflow as backend

Keras uses Tensorflow by default. Check the contents of ~/.keras/keras.json:

    "image_dim_ordering": "tf",
    "epsilon": 1e-07,
    "floatx": "float32",
    "backend": "tensorflow"

Using Theano as backend

Edit the contents of ~/.keras/keras.json:

    "image_dim_ordering": "th", 
    "epsilon": 1e-07, 
    "floatx": "float32", 
    "backend": "theano"

Check the Backend being used

from keras import backend as K
print K.backend()
print K.image_dim_ordering()
## Set image dimesnion order for Tensorflow, so that no modifications are required in the code
if K.backend() =='tensorflow':
    print K.image_dim_ordering()

Using GPU

For tensorflow, GPU is used by default. To use GPU for Theano, add this code in the beggining of the file:

import os
os.environ["THEANO_FLAGS"] = "mode=FAST_RUN, device=gpu, floatX=float32"



Video Lectures:



Thank you to Laura Graesser for her Neural Networks workshop and WiMDS for organizing it.

You can’t perform that action at this time.