October 2018
Beginner
362 pages
9h 32m
English
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 ...