Implementing the project

Now that we know how an RNN is able to build a character-level model, let's implement the project to generate our own words and sentences through an RNN. Generally, RNN training is computationally intensive and it is suggested that we run the code on a graphical processing unit (GPU). However, due to infrastructure limitations, we are not going to use a GPU for the project code. The mxnet library allows a character-level language model with an RNN to be executed on the CPU itself, so let's start coding our project:

# including the required librarieslibrary("readr")library("stringr")library("stringi")library("mxnet")library("languageR")

To use the languageR library's ALICE'S ADVENTURES IN WONDERLAND book text and load ...

Get R Machine Learning Projects now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.