Python Deep Learning - Environment


In this chapter, we will learn about the environment set up for Python Deep Learning. We have to install the following software for making deep learning algorithms.

  • Python 2.7+
  • Scipy with Numpy
  • Matplotlib
  • Theano
  • Keras
  • TensorFlow

It is strongly recommend that Python, NumPy, SciPy, and Matplotlib are installed through the Anaconda distribution. It comes with all of those packages.

We need to ensure that the different types of software are installed properly.

Let us go to our command line program and type in the following command −

$ python
Python 3.6.3 |Anaconda custom (32-bit)| (default, Oct 13 2017, 14:21:34)
[GCC 7.2.0] on linux

Next, we can import the required libraries and print their versions −

import numpy
print numpy.__version__



Installation of Theano, TensorFlow and Keras

Before we begin with the installation of the packages − Theano, TensorFlow and Keras, we need to confirm if the pip is installed. The package management system in Anaconda is called the pip.

To confirm the installation of pip, type the following in the command line −

$ pip

Once the installation of pip is confirmed, we can install TensorFlow and Keras by executing the following command −

$pip install theano
$pip install tensorflow
$pip install keras

Confirm the installation of Theano by executing the following line of code −

$python –c “import theano: print (theano.__version__)”



Confirm the installation of Tensorflow by executing the following line of code −

$python –c “import tensorflow: print tensorflow.__version__”



Confirm the installation of Keras by executing the following line of code −

$python –c “import keras: print keras.__version__”
Using TensorFlow backend