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

Python Deep Learning Projects: 9 projects demystifying neural network and deep learning models for building intelligent systems

eBook
€29.99
Paperback
€36.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Table of content icon View table of contents Preview book icon Preview Book

Python Deep Learning Projects

Training NN for Prediction Using Regression

Welcome to our first proper project in Python deep learning! What we'll be doing today is building a classifier to solve the problem of identifying specific handwriting samples from a dataset of images. We've been asked (in this hypothetical use case) to do this by a restaurant chain that has the need to accurately classify handwritten numbers into digits. What they have their customers do is write their phone numbers in a simple iPad application. At the time when they can be seated, the guest will get a text prompting them to come and see the restaurant's host. We need to accurately classify the handwritten numbers, so that the output from the app will be accurately predicted labels for the digits of a phone number. This can then be sent to their (hypothetical) auto dialer service for text messages, and the notice gets...

Building a regression model for prediction using an MLP deep neural network

In any real job working in an AI team, one of the primary goals will be to build regression models that can make predictions in non-linear datasets. Because of the complexity of the real world and the data that you'll be working with, simple linear regression models won't provide the predictive power you're seeking. That is why, in this chapter, we will discuss how to build world-class prediction models using MLP. More information can be found at http://www.deeplearningbook.org/contents/mlp.html, and an example of the MLP architecture is shown here:

An MLP with two hidden layers

We will implement a neural network with a simple architecture of only two layers, using TensorFlow, that will perform regression on the MNIST dataset (http://yann.lecun.com/exdb/mnist/) that we will provide. We...

Exploring the MNIST dataset

Before we jump into building our awesome neural network, let's first have a look at the famous MNIST dataset. So let's visualize the MNIST dataset in this section.

Words of wisdom: You must know your data and how it has been preprocessed, in order to know why the models you build perform the way they do. This section reviews the significant work that has been done in preparation on the dataset, to make our current job of building the MLP easier. Always remember: data science begins with DATA!

Let's start therefore by downloading the data, using the following commands:

from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("/tmp/data/", one_hot=True)

If we examine the mnist variable content, we can see that it is structured in a specific format, with three major components—TRAIN, TEST...

Intuition and preparation

Let's build our intuition around this project. What we need to do is build a deep learning technology that accurately assigns class labels to an input image. We're using a deep neural network, known as an MLP, to do this. The core of this technology is the mathematics of regression. The specific calculus proofs are outside the scope of this book, but in this section, we provide a foundational basis for your understanding. We also outline the structure of the project, so that it's easy to understand the primary steps needed to create our desired results.

Defining regression

Our first task is to define the model that will perform regression on the provided MNIST dataset. So, we will...

Let's code the implementation!

To code the implementation, we'll start by defining the hyperparameters, then we will define the model, followed by building and executing the training loop. We conclude by checking to see if our model is overfitting and build an inference code that loads the latest checkpoints and then makes predictions on the basis of learned parameters.

Defining hyperparameters

We will define all of the required hyperparameters in the hy_param.py file and then import it as a module in our other codes. This makes it easy in deployment, and is good practice to make your code as modular as possible. Let's look into the hyperparameter configurations that we have in our hy_param.py file:

#!/usr/bin...

Concluding the project

Today's project was to build a classifier to solve the problem of identifying specific handwriting samples from a dataset of images. Our hypothetical use case was to apply deep learning to enable customers of a restaurant chain to write their phone numbers in a simple iPad application, so that they could get a text notification that their party was ready to be seated. Our specific task was to build the intelligence that would drive this application.

Revisit our success criteria: How did we do? Did we succeed? What was the impact of our success? Just as we defined success at the beginning of the project, these are the key questions that we need to ask as deep learning data scientists, as we look to wrap up a project.

Our MLP model accuracy hit 87.42%! Not bad, given the depth of the model and the hyperparameters that we chose at the beginning. See if...

Summary

In the project in this chapter, we successfully built an MLP to produce a regression classification prediction, based on handwritten digits. We gained experience with the MNIST dataset and a deep neural network model architecture, which gave us the added opportunity to define some key hyperparameters. Finally, we looked at the model performance in testing and determined whether we succeeded in achieving our goals.

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Explore deep learning across computer vision, natural language processing (NLP), and image processing
  • Discover best practices for the training of deep neural networks and their deployment
  • Access popular deep learning models as well as widely used neural network architectures

Description

Deep learning has been gradually revolutionizing every field of artificial intelligence, making application development easier. Python Deep Learning Projects imparts all the knowledge needed to implement complex deep learning projects in the field of computational linguistics and computer vision. Each of these projects is unique, helping you progressively master the subject. You’ll learn how to implement a text classifier system using a recurrent neural network (RNN) model and optimize it to understand the shortcomings you might experience while implementing a simple deep learning system. Similarly, you’ll discover how to develop various projects, including word vector representation, open domain question answering, and building chatbots using seq-to-seq models and language modeling. In addition to this, you’ll cover advanced concepts, such as regularization, gradient clipping, gradient normalization, and bidirectional RNNs, through a series of engaging projects. By the end of this book, you will have gained knowledge to develop your own deep learning systems in a straightforward way and in an efficient way

Who is this book for?

Python Deep Learning Projects is for you if you want to get insights into deep learning, data science, and artificial intelligence. This book is also for those who want to break into deep learning and develop their own AI projects. It is assumed that you have sound knowledge of Python programming

What you will learn

  • Set up a deep learning development environment on Amazon Web Services (AWS)
  • Apply GPU-powered instances as well as the deep learning AMI
  • Implement seq-to-seq networks for modeling natural language processing (NLP)
  • Develop an end-to-end speech recognition system
  • Build a system for pixel-wise semantic labeling of an image
  • Create a system that generates images and their regions

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Oct 31, 2018
Length: 472 pages
Edition : 1st
Language : English
ISBN-13 : 9781789134759
Category :
Languages :
Concepts :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want

Product Details

Publication date : Oct 31, 2018
Length: 472 pages
Edition : 1st
Language : English
ISBN-13 : 9781789134759
Category :
Languages :
Concepts :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 99.97
Advanced Deep Learning with Keras
€32.99
Python Deep Learning Projects
€36.99
Keras Deep Learning Cookbook
€29.99
Total 99.97 Stars icon

Table of Contents

16 Chapters
Building Deep Learning Environments Chevron down icon Chevron up icon
Training NN for Prediction Using Regression Chevron down icon Chevron up icon
Word Representation Using word2vec Chevron down icon Chevron up icon
Building an NLP Pipeline for Building Chatbots Chevron down icon Chevron up icon
Sequence-to-Sequence Models for Building Chatbots Chevron down icon Chevron up icon
Generative Language Model for Content Creation Chevron down icon Chevron up icon
Building Speech Recognition with DeepSpeech2 Chevron down icon Chevron up icon
Handwritten Digits Classification Using ConvNets Chevron down icon Chevron up icon
Object Detection Using OpenCV and TensorFlow Chevron down icon Chevron up icon
Building Face Recognition Using FaceNet Chevron down icon Chevron up icon
Automated Image Captioning Chevron down icon Chevron up icon
Pose Estimation on 3D models Using ConvNets Chevron down icon Chevron up icon
Image Translation Using GANs for Style Transfer Chevron down icon Chevron up icon
Develop an Autonomous Agent with Deep R Learning Chevron down icon Chevron up icon
Summary and Next Steps in Your Deep Learning Career Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Empty star icon Empty star icon 3
(4 Ratings)
5 star 25%
4 star 0%
3 star 50%
2 star 0%
1 star 25%
beryl sirmacek Jan 08, 2019
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Great book for strengthening deep learning skills following the well described examples. You can benefit from this book for your education, teaching activities, as well as for your company and business development in this field.
Amazon Verified review Amazon
bptsj Jan 06, 2019
Full star icon Full star icon Full star icon Empty star icon Empty star icon 3
I plan to spend the next 4mo studying this material and executing the 9 projects. I've had the book for two weeks and so far am not impressed. The first project uses a MLP NN for solving the MNIST handwritten digit problem and concludes the MLP model is not accurate enough (85%). I would have skipped the MLP and just started with the CNN NN. I have done this based on online tutorials and the accuracy was greater than 97%. The book is light on content. On each subject it has a few introductory words then a link to other sources for content and a walk-through on the project code. I think I would have been better off searching the web for the best tutorials on the topics of the 9 projects.To be fair I will update my review when I finish the first 3 projects.
Amazon Verified review Amazon
ABHIJIT Jan 20, 2019
Full star icon Full star icon Full star icon Empty star icon Empty star icon 3
Bad print . Very difficult to read.
Amazon Verified review Amazon
FutureDoc Aug 31, 2023
Full star icon Empty star icon Empty star icon Empty star icon Empty star icon 1
I had such high hopes for this book. It is 5 years old, but I assumed the code on GitHub would have been kept updated, like it implies in the book. But the GitHub files haven't been updated in 5 years. And when I try to run these on my local machine as well as Google Colab, I keep getting version errors. I'm not willing to do all the behind the scenes work to get these to run before I can even use them.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.