Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Python Deep Learning Projects

You're reading from   Python Deep Learning Projects 9 projects demystifying neural network and deep learning models for building intelligent systems

Arrow left icon
Product type Paperback
Published in Oct 2018
Publisher Packt
ISBN-13 9781788997096
Length 472 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (3):
Arrow left icon
Rahul Kumar Rahul Kumar
Author Profile Icon Rahul Kumar
Rahul Kumar
Matthew Lamons Matthew Lamons
Author Profile Icon Matthew Lamons
Matthew Lamons
Abhishek Nagaraja Abhishek Nagaraja
Author Profile Icon Abhishek Nagaraja
Abhishek Nagaraja
Arrow right icon
View More author details
Toc

Table of Contents (17) Chapters Close

Preface 1. Building Deep Learning Environments 2. Training NN for Prediction Using Regression FREE CHAPTER 3. Word Representation Using word2vec 4. Building an NLP Pipeline for Building Chatbots 5. Sequence-to-Sequence Models for Building Chatbots 6. Generative Language Model for Content Creation 7. Building Speech Recognition with DeepSpeech2 8. Handwritten Digits Classification Using ConvNets 9. Object Detection Using OpenCV and TensorFlow 10. Building Face Recognition Using FaceNet 11. Automated Image Captioning 12. Pose Estimation on 3D models Using ConvNets 13. Image Translation Using GANs for Style Transfer 14. Develop an Autonomous Agent with Deep R Learning 15. Summary and Next Steps in Your Deep Learning Career 16. Other Books You May Enjoy

DL environment setup locally

Throughout this book, we will be using Ubuntu OS to run all the experiments, because there is great community support for Linux and mostly any DL application can be set up easily on Linux. For any assistance on installation and setup related to Ubuntu, please refer to the tutorials at https://tutorials.ubuntu.com/. On top of that, this book will use the Anaconda package with Python 2.7+ to write our code, train, and test. Anaconda comes with a huge list of pre-installed Python packages, such as numpy, pandas, sklearn, and so on, which are commonly used in all kinds of data science projects.

Why do we need Anaconda? Can't we use Vanilla Python?
Anaconda is a generic bundle that contains iPython Notebook, editor, and lots of Python libraries preinstalled, which saves a lot of time on setting up everything. With Anaconda, we can quickly get started on solving the data science problem, instead of configuring the environment.
But, yes, you can use the default Python—it's totally the reader's choice, and we will learn at the end of this chapter how to configure python env using script.

Downloading and installing Anaconda

Anaconda is a very popular data science platform for people using Python to build machine learning and DL models, and deployable applications. The Anaconda marketing team put it best on their What is Anaconda? page, available at https://www.anaconda.com/what-is-anaconda/. To install Anaconda, perform the following steps:

  1. Click Anaconda on the menu, then click Downloads to go to the download page at https://www.anaconda.com/download/#linux
  2. Choose the download suitable for your platform (Linux, OS X, or Windows):
    1. Choose Python 3.6 version*
    2. Choose the Graphical Installer
  3. Follow the instructions on the wizard, and in 10 to 20 minutes, your Anaconda environment (Python) setup will be ready

Once the installation process is completed, you can use following command to check the Python version on your Terminal:

python -V

You should see the following output:

Python 3.6 :: Anaconda,Inc.

If the command does not work, or returns an error, please check the documentation for help for your platform.

Installing DL libraries

Now, let's install the Python libraries used for DL, specifically, TensorFlow and Keras.

What is TensorFlow?
TensorFlow is a Python library developed and maintained by Google. You can implement many powerful machine learning and DL architectures in custom models and applications using TensorFlow. To find out more, visit https://www.tensorflow.org/.

Install the TensorFlow DL library (for all OS except Windows) by typing the following command:

conda install -c conda-forge tensorflow

Alternatively, you may choose to install using pip and a specific version of TensorFlow for your platform, using the following command:

pip install tensorflow==1.6

You can find the installation instructions for TensorFlow at https://www.tensorflow.org/get_started/os_setup#anaconda_installation.

Now we will install keras using the following command:

pip install keras

To validate the environment and the version of the packages, let's write the following script, which will print the version numbers of each library:

# Import the tensorflow library
import tensorflow
# Import the keras library
import keras

print('tensorflow: %s' % tensorflow.__version__)
print('keras: %s' % keras.__version__)

Save the script as dl_versions.py. Run the script by typing the following command:

python dl_version.py

You should see the following output:

tensorflow: 1.6.0
Using TensorFlow backend.
keras: 2.1.5

Voila! Now our Python development environment is ready for us to write some awesome DL applications in our local.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime