Skip to Main Content
Hands-On Artificial Intelligence for Beginners
book

Hands-On Artificial Intelligence for Beginners

by David Dindi, Patrick D. Smith
October 2018
Beginner content levelBeginner
362 pages
9h 32m
English
Packt Publishing
Content preview from Hands-On Artificial Intelligence for Beginners

Vanilla recurrent neural networks

Let's walk through the architecture of a basic RNN; to illustrate, we are going to create a basic RNN that predicts the next letter in a sequence. For our training data, we will be using the opening paragraph of Shakespeare's Hamlet. Let's go ahead and save that corpus as a variable that we can use in our network.

corpus = "Hamlet was the only son of the King of Denmark. He loved his father and mother dearly--and was happy in the love of a sweet lady named Ophelia. Her father, Polonius, was the King's Chamberlain. While Hamlet was away studying at Wittenberg, his father died. Young Hamlet hastened home in great grief to hear that a serpent had stung the King, and that he was dead. The young Prince had loved ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Artificial Intelligence and Machine Learning Fundamentals

Artificial Intelligence and Machine Learning Fundamentals

Zsolt Nagy

Publisher Resources

ISBN: 9781788991063Supplemental Content