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
Hands-On Deep Learning Algorithms with Python

You're reading from   Hands-On Deep Learning Algorithms with Python Master deep learning algorithms with extensive math by implementing them using TensorFlow

Arrow left icon
Product type Paperback
Published in Jul 2019
Publisher Packt
ISBN-13 9781789344158
Length 512 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Sudharsan Ravichandiran Sudharsan Ravichandiran
Author Profile Icon Sudharsan Ravichandiran
Sudharsan Ravichandiran
Arrow right icon
View More author details
Toc

Table of Contents (17) Chapters Close

Preface 1. Section 1: Getting Started with Deep Learning FREE CHAPTER
2. Introduction to Deep Learning 3. Getting to Know TensorFlow 4. Section 2: Fundamental Deep Learning Algorithms
5. Gradient Descent and Its Variants 6. Generating Song Lyrics Using RNN 7. Improvements to the RNN 8. Demystifying Convolutional Networks 9. Learning Text Representations 10. Section 3: Advanced Deep Learning Algorithms
11. Generating Images Using GANs 12. Learning More about GANs 13. Reconstructing Inputs Using Autoencoders 14. Exploring Few-Shot Learning Algorithms 15. Assessments 16. Other Books You May Enjoy

Generating song lyrics using RNNs

We have learned enough about RNNs; now, we will look at how to generate song lyrics using RNNs. To do this, we simply build a character-level RNN, meaning that on every time step, we predict a new character.

Let's consider a small sentence, What a beautiful d.

At the first time step, the RNN predicts a new character as a. The sentence will be updated to, What a beautiful da.

At the next time step, it predicts a new character as y, and the sentence becomes, What a beautiful day.

In this manner, we predict a new character at each time step and generate a song. Instead of predicting a new character every time, we can also predict a new word every time, which is called word level RNN. For simplicity, let's start with a character level RNN.

But how does RNN predicts a new character on each time step? Let's suppose at a time step t=0...

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