Recurrent Neural Networks with Python Quick Start Guide - Simeon Kostadinov - E-Book

Recurrent Neural Networks with Python Quick Start Guide E-Book

Simeon Kostadinov

0,0
23,99 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.

Mehr erfahren.
Beschreibung

Developers struggle to find an easy-to-follow learning resource for implementing Recurrent Neural Network (RNN) models. RNNs are the state-of-the-art model in deep learning for dealing with sequential data. From language translation to generating captions for an image, RNNs are used to continuously improve results. This book will teach you the fundamentals of RNNs, with example applications in Python and the TensorFlow library. The examples are accompanied by the right combination of theoretical knowledge and real-world implementations of concepts to build a solid foundation of neural network modeling.
Your journey starts with the simplest RNN model, where you can grasp the fundamentals. The book then builds on this by proposing more advanced and complex algorithms. We use them to explain how a typical state-of-the-art RNN model works. From generating text to building a language translator, we show how some of today's most powerful AI applications work under the hood.
After reading the book, you will be confident with the fundamentals of RNNs, and be ready to pursue further study, along with developing skills in this exciting field.

Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:

EPUB
MOBI

Seitenzahl: 136

Veröffentlichungsjahr: 2018

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



Recurrent Neural Networks with Python Quick Start Guide

 

Sequential learning and language modeling with TensorFlow

 

 

 

 

 

 

 

 

 

 

 

 

Simeon Kostadinov

 

 

 

 

 

 

 

 

 

BIRMINGHAM - MUMBAI

Recurrent Neural Networks with Python Quick Start Guide

Copyright © 2018 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author(s), nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

Commissioning Editor: Amey VarangaonkarAcquisition Editor: Siddharth MandalContent Development Editor:Roshan KumarTechnical Editor: Sushmeeta JenaCopy Editor: Safis EditingProject Coordinator: Hardik BindeProofreader: Safis EditingIndexer: Mariammal ChettiyarGraphics: Alishon MendonsaProduction Coordinator: Aparna Bhagat

First published: November 2018

Production reference: 1281118

 

Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK.

 

ISBN 978-1-78913-233-5

www.packtpub.com

 
mapt.io

Mapt is an online digital library that gives you full access to over 5,000 books and videos, as well as industry leading tools to help you plan your personal development and advance your career. For more information, please visit our website.

Why subscribe?

Spend less time learning and more time coding with practical eBooks and Videos from over 4,000 industry professionals

Improve your learning with Skill Plans built especially for you

Get a free eBook or video every month

Mapt is fully searchable

Copy and paste, print, and bookmark content

Packt.com

Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.packt.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at [email protected] for more details.

At www.packt.com, you can also read a collection of free technical articles, sign up for a range of free newsletters, and receive exclusive discounts and offers on Packt books and eBooks. 

Contributors

About the author

Simeon Kostadinov is a software engineer and deep learning enthusiast who loves learning while being involved in long-term projects that aim to improve peoples' lives. He is currently in his final year at the University of Birmingham studying computer science. During his studies, he spent a year in San Francisco working with the incredibly smart Speechify team. His programming knowledge includes Swift, Python, and JavaScript. Simeon is also passionate about the field of AI and how it can transform the businesses of today.

I would like to thank my friend, Boyan, for taking the time to review the book so diligently. Also, I want to express my gratitude to my girlfriend, Sofia, for the constant support during my writing. This book wouldn't have been possible without the help of the whole Packt team, including Roshan, Siddharth, and many more. Finally, I want to thank my friends, Vladimir and Cliff; as well as my brother, Valentin; my mom, Ekaterina; and my dad, Valentin.

 

About the reviewer

Boyan Bonev is a software engineer and machine learning enthusiast with experience in web and desktop development. He has been an intern for both IBM and CERN and so is highly skilled in C#, JavaScript, Java, Python, Haskell, and various frameworks. He has also been involved in working with teams using different agile techniques. He is very passionate about cognitive technologies that will change the future, which is why he has taken so many Coursera courses. Outside his hobby, he loves spending time with his family and friends. Boyan is also very passionate about helping young adults who have been diagnosed with leukemia.

I would like to thank Simeon for his enthusiasm and professionalism in writing this book. I think that he has done a wonderful job. I am more than sure that the way he has done it will be of huge benefit to many people.

 

 

 

 

Packt is searching for authors like you

If you're interested in becoming an author for Packt, please visit authors.packtpub.com and apply today. We have worked with thousands of developers and tech professionals, just like you, to help them share their insight with the global tech community. You can make a general application, apply for a specific hot topic that we are recruiting an author for, or submit your own idea.

Table of Contents

Title Page

Copyright and Credits

Recurrent Neural Networks with Python Quick Start Guide

About Packt

Why subscribe?

Packt.com

Contributors

About the author

About the reviewer

Packt is searching for authors like you

Preface

Who this book is for

What this book covers

To get the most out of this book

Download the example code files

Download the color images

Conventions used

Get in touch

Reviews

Introducing Recurrent Neural Networks

What is an RNN?

Comparing recurrent neural networks with similar models

Hidden Markov model

Recurrent neural network

Understanding how recurrent neural networks work

Basic neural network overview

Obtaining data

Encoding the data

Building the architecture 

Training the model

Evaluating the model

Key problems with the standard recurrent neural network model

Summary

External links

Building Your First RNN with TensorFlow

What are you going to build?

Introduction to TensorFlow

Graph-based execution

Eager execution

Coding the recurrent neural network

Generating data

Building the TensorFlow graph

Training the RNN

Evaluating the predictions

Summary

External links

Generating Your Own Book Chapter

Why use the GRU network?

Generating your book chapter

Obtaining the book text

Encoding the text

Building the TensorFlow graph

Training the network

Generating your new text

Summary

External links

Creating a Spanish-to-English Translator

Understanding the translation model

What is an LSTM network?

Understanding the sequence-to-sequence network with attention

Building the Spanish-to-English translator

Preparing the data

Constructing the TensorFlow graph

Training the model

Predicting the translation

Evaluating the final results

Summary

External links

Building Your Personal Assistant

What are we building?

Preparing the data

Creating the chatbot network

Training the chatbot

Building a conversation

Summary

External links

Improving Your RNN Performance

Improving your RNN model

Improving performance with data

Selecting data

Processing data

Transforming data

Improving performance with tuning

Grid search

Random search 

Hand-tuning

Bayesian optimization

Tree-structured Parzen Estimators (TPE)

Optimizing the TensorFlow library

Data processing

Improving data loading

Improving data transformation

Performing the training

Optimizing gradients

Summary

External links

Other Books You May Enjoy

Leave a review - let other readers know what you think

Preface

Deep learning (DL) is an increasingly popular topic that attracts the attention of the largest corporations as well as that of all kinds of developers. Over the past five years, this field has seen massive improvements that have ultimately led us to think of DL as a highly disruptive technology with immense potential. Virtual assistants, speech recognition, and language translation are just a few examples of the direct implementation of DL techniques. Compared to image recognition or object detection, these applications use sequential data, where the nature of every result depends upon that of the previous one. For example, you can't produce a meaningful translation of a sentence from English to Spanish without tracking the words from beginning to end. For these kinds of problems, a specific type of model is being used—the recurrent neural network (RNN). In this book, we will cover the basics of RNNs and focus on some practical implementations using the popular DL library TensorFlow. All examples are accompanied by in-depth explanations of the theory to help you understand the underlying concepts behind this powerful but slightly complex model. Reading this book will leave you confident in your knowledge of RNNs and give you a good head start in using this model for your own specific use cases.

Who this book is for

This book is for machine learning engineers and data scientists who want to learn about RNNs by looking at practical use cases.

What this book covers

Chapter 1,  Introducing Recurrent Neural Networks, will provide you with a brief introduction to the basics of RNNs and will compare the model to other popular models and demonstrate why RNNs are the best. This chapter will then illustrate RNNs with the use of an example. You will also be given insight into the problems that RNNs have.

Chapter 2, Building Your First RNN with TensorFlow, will explore how to build a simple RNN to solve the problem of identifying sequence parity. You will also gain a brief understanding of the TensorFlow library and how it can be utilized for building DL models. After reading this chapter, you should have a full understanding of how to use TensorFlow with Python and how easy and straightforward it is to build a neural network.

Chapter 3, Generating Your Own Book Chapter, will also introduce a new and more powerful RNN model called the gated recurrent unit (GRU). You will learn how it works and why we are choosing it over the simple RNN. You will also go step by step over the process of generating a book chapter. By the end of this chapter, you should have gained both a theoretical and a practical knowledge that will give you the freedom to experiment with any problems of medium difficulty.

Chapter 4, Creating a Spanish-to-English Translator, will walk you through building a fairly sophisticated neural network model using the sequence-to-sequence model implemented with the TensorFlow library. You will build a simple version of a Spanish-to-English translator, which will accept a sentence in Spanish and output its English equivalent.

Chapter 5, Building Your Personal Assistant, will then look on the practical side of RNNs and have you build a conversational chatbot. This chapter reveals a full implementation of a chatbot system that manages to construct a short conversation. You will then create an end-to-end model that aims to yield meaningful results. You will make use of a high-level TensorFlow-based library called TensorLayer.

Chapter 6, Improving Your RNN's Performance, will go through some techniques for improving your RNN. This chapter will focus on improving your RNN's performance with data and tuning. You will also look into optimizing the TensorFlow library for better results. 

To get the most out of this book

You need a basic knowledge of Python 3.6.x and basic knowledge of Linux commands. Previous experience with TensorFlow would be helpful, but is not mandatory.

Download the example code files

You can download the example code files for this book from your account at www.packt.com. If you purchased this book elsewhere, you can visit www.packt.com/support and register to have the files emailed directly to you.

You can download the code files by following these steps:

Log in or register at

www.packt.com

.

Select the

SUPPORT

tab.

Click on

Code Downloads & Errata

.

Enter the name of the book in the

Search

box and follow the onscreen instructions.

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/Recurrent-Neural-Networks-with-Python-Quick-Start-Guide. In case there's an update to the code, it will be updated on the existing GitHub repository.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Download the color images

We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it here: https://www.packtpub.com/sites/default/files/downloads/9781789132335_ColorImages.pdf.

Get in touch

Feedback from our readers is always welcome.

General feedback: If you have questions about any aspect of this book, mention the book title in the subject of your message and email us at [email protected].

Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packt.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details.

Piracy: If you come across any illegal copies of our works in any form on the Internet, we would be grateful if you would provide us with the location address or website name. Please contact us at [email protected] with a link to the material.

If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.

Reviews

Please leave a review. Once you have read and used this book, why not leave a review on the site that you purchased it from? Potential readers can then see and use your unbiased opinion to make purchase decisions, we at Packt can understand what you think about our products, and our authors can see your feedback on their book. Thank you!

For more information about Packt, please visit packt.com.

Introducing Recurrent Neural Networks

This chapter will introduce you to the theoretical side of the recurrent neural network (RNN) model. Gaining knowledge about what lies behind this powerful architecture will give you a head start on mastering the practical examples that are provided later in the book. Since you may often find yourself in a situation where a critical decision for your application is needed, it is essential to be aware of the building parts of this model. This will help you act appropriately for the situation.

The prerequisite knowledge for this chapter includes basic linear algebra (matrix operations). A basic knowledge in deep learning and neural networks is also a plus. If you are new to that field, I would recommend first watching the great series of videos made by Andrew Ng (https://www.youtube.com/playlist?list=PLkDaE6sCZn6Ec-XTbcX1uRg2_u4xOEky0