Reader small image

You're reading from  Recurrent Neural Networks with Python Quick Start Guide

Product typeBook
Published inNov 2018
Reading LevelIntermediate
PublisherPackt
ISBN-139781789132335
Edition1st Edition
Languages
Right arrow
Author (1)
Simeon Kostadinov
Simeon Kostadinov
author image
Simeon Kostadinov

Simeon Kostadinoff works for a startup called Speechify which aims to help people go through their readings faster by converting any text into speech. Simeon is Machine Learning enthusiast who writes a blog and works on various projects on the side. He enjoys reading different research papers and implement some of them in code. He was ranked number 1 in mathematics during his senior year of high school and thus he has deep passion about understanding how the deep learning models work under the hood. His specific knowledge in Recurrent Neural Networks comes from several courses that he has taken at Stanford University and University of Birmingham. They helped in understanding how to apply his theoretical knowledge into practice and build powerful models. In addition, he recently became a Stanford Scholar Initiative which includes working in a team of Machine Learning researchers on a specific deep learning research paper.
Read more about Simeon Kostadinov

Right arrow

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 TensorFlowwill 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 Chapterwill 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:

  1. Log in or register at www.packt.com.
  2. Select the SUPPORT tab.
  3. Click on Code Downloads & Errata.
  4. 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-GuideIn 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

Conventions used

There are a number of text conventions used throughout this book.

CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "Mount the downloaded WebStorm-10*.dmg disk image file as another disk in your system."

A block of code is set as follows:

def generate_data():
inputs = input_values()
return inputs, output_values(inputs)

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

 loss = tf.nn.softmax_cross_entropy_with_logits_v2(labels=Y,    
logits=prediction)
total_loss = tf.reduce_mean(loss)

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

import tensorflow as tf
import random

Bold: Indicates a new term, an important word, or words that you see onscreen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "Select System info from the Administration panel."

Warnings or important notes appear like this.
Tips and tricks appear like this.

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 customercare@packtpub.com.

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 copyright@packt.com 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.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Recurrent Neural Networks with Python Quick Start Guide
Published in: Nov 2018Publisher: PacktISBN-13: 9781789132335
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.
undefined
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 $15.99/month. Cancel anytime

Author (1)

author image
Simeon Kostadinov

Simeon Kostadinoff works for a startup called Speechify which aims to help people go through their readings faster by converting any text into speech. Simeon is Machine Learning enthusiast who writes a blog and works on various projects on the side. He enjoys reading different research papers and implement some of them in code. He was ranked number 1 in mathematics during his senior year of high school and thus he has deep passion about understanding how the deep learning models work under the hood. His specific knowledge in Recurrent Neural Networks comes from several courses that he has taken at Stanford University and University of Birmingham. They helped in understanding how to apply his theoretical knowledge into practice and build powerful models. In addition, he recently became a Stanford Scholar Initiative which includes working in a team of Machine Learning researchers on a specific deep learning research paper.
Read more about Simeon Kostadinov