Book Image

Python Deep Learning

By : Valentino Zocca, Gianmario Spacagna, Daniel Slater, Peter Roelants
Book Image

Python Deep Learning

By: Valentino Zocca, Gianmario Spacagna, Daniel Slater, Peter Roelants

Overview of this book

With an increasing interest in AI around the world, deep learning has attracted a great deal of public attention. Every day, deep learning algorithms are used broadly across different industries. The book will give you all the practical information available on the subject, including the best practices, using real-world use cases. You will learn to recognize and extract information to increase predictive accuracy and optimize results. Starting with a quick recap of important machine learning concepts, the book will delve straight into deep learning principles using Sci-kit learn. Moving ahead, you will learn to use the latest open source libraries such as Theano, Keras, Google's TensorFlow, and H20. Use this guide to uncover the difficulties of pattern recognition, scaling data with greater accuracy and discussing deep learning algorithms and techniques. Whether you want to dive deeper into Deep Learning, or want to investigate how to get more out of this powerful technology, you’ll find everything inside.
Table of Contents (18 chapters)
Python Deep Learning
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface
Index

Preface

With an increasing interest in AI around the world, deep learning has attracted a great deal of public attention. Every day, deep-learning algorithms are used broadly across different industries. This book will give you all the practical information available on the subject, including best practices, using real-world use cases. You will learn to recognize and extract information to increase predictive accuracy and optimize results.

Starting with a quick recap of important machine learning concepts, the book will delve straight into deep learning principles using scikit-learn. Moving ahead, you will learn to use the latest open source libraries, such as Theano, Keras, Google's TensorFlow, and H2O. Use this guide to uncover the difficulties of pattern recognition, scaling data with greater accuracy, and discussing deep-learning algorithms and techniques. Whether you want to dive deeper into deep learning or want to investigate how to get more out of this powerful technology, you'll find everything inside.

What this book covers

Chapter 1, Machine Learning – An Introduction, presents different machine learning approaches and techniques and some of their applications to real-world problems. We will introduce one of the major open source packages available in Python for machine learning, scikit-learn.

Chapter 2, Neural Networks, formally introduces what neural networks are. We will thoroughly describe how a neuron works and will see how we can stack many layers to create and use deep feed-forward neural networks.

Chapter 3, Deep Learning Fundamentals, walks you toward an understanding of what deep learning is and how it is related to deep neural networks.

Chapter 4, Unsupervised Feature Learning, covers two of the most powerful and often-used architectures for unsupervised feature learning: auto-encoders and restricted Boltzmann machines.

Chapter 5, Image Recognition, starts from drawing an analogy with how our visual cortex works and introduces convolutional layers, followed up with a descriptive intuition of why they work.

Chapter 6, Recurrent Neural Networks and Language Models, discusses powerful methods that have been very promising in a lot of tasks, such as language modeling and speech recognition.

Chapter 7, Deep Learning for Board Games, covers the different tools used for solving board games such as checkers and chess.

Chapter 8, Deep Learning for Computer Games, looks at the more complex problem of training AI to play computer games.

Chapter 9, Anomaly Detection, starts by explaining the difference and similarities of concepts between outlier detection and anomaly detection. You will be guided through an imaginary fraud case study, followed by examples showing the danger of having anomalies in real-world applications and the importance of automated and fast detection systems.

Chapter 10, Building a Production-Ready Intrusion Detection System, leverages H2O and general common practices to build a scalable distributed system ready for deployment in production. You will learn how to train a deep learning network using Spark and MapReduce, how to use adaptive learning techniques for faster convergence and very important how to validate a model and evaluate the end to end pipeline.

What you need for this book

You will be able to work on any of the following OSes: Windows, Linux, and Macintosh.

To be able to smoothly follow through the chapters, you will need the following:

  • TensorFlow

  • Theano

  • Keras

  • Matplotlib

  • H2O .

  • scikit-learn

Who this book is for

This book is for data science practitioners as well as aspirants who have a basic foundational understanding of machine learning concepts and some programming experience with Python. A mathematical background with a conceptual understanding of calculus and statistics is also desired.

Conventions

In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: The code above for drawing should be immediately clear, we just notice that the line importing cm.

A block of code is set as follows:

(X_train, Y_train), (X_test, Y_test) = cifar10.load_data()
X_train = X_train.reshape(50000, 3072)
X_test = X_test.reshape(10000, 3072)
input_size = 3072

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

def monte_carlo_tree_search_uct(board_state, side, number_of_rollouts):
    state_results = collections.defaultdict(float)
    state_samples = collections.defaultdict(float)

Any command-line input or output is written as follows:

git clone https://github.com/fchollet/keras.git
cd keras
python setup.py install

New terms and important words are shown in bold.

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.

To send us general feedback, simply e-mail , and mention the book's title in the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for this book from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

You can download the code files by following these steps:

  • Log in or register to our website using your e-mail address and password.

  • Hover the mouse pointer on the SUPPORT tab at the top.

  • Click on Code Downloads & Errata.

  • Enter the name of the book in the Search box.

  • Select the book for which you're looking to download the code files.

  • Choose from the drop-down menu where you purchased this book from.

  • Click on Code Download.

You can also download the code files by clicking on the Code Files button on the book's webpage at the Packt Publishing website. This page can be accessed by entering the book's name in the Search box. Please note that you need to be logged in to your Packt account.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR / 7-Zip for Windows

  • Zipeg / iZip / UnRarX for Mac

  • 7-Zip / PeaZip for Linux

The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Python-Deep-Learning. We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Downloading the color images of this book

We also provide you with a PDF file that has color images of the screenshots/diagrams used in this book. The color images will help you better understand the changes in the output. You can download this file from https://www.packtpub.com/sites/default/files/downloads/PythonDeepLearning_ColorImages.pdf.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.

Piracy

Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

If you have a problem with any aspect of this book, you can contact us at and we will do our best to address the problem.