How it works...
In step 1, we divided the input data into training and validation and created data iterators for each. These data iterators are iterator objects that allow fetching batches of data sequentially by calling next, each batch containing some training examples and their respective labels.In step 2, we created an RNN symbol. We specified the number of layers as two and the number of hidden units as 30. We configured the type of RNN cell to lstm and set the config parameter to one-to-one. In the next step, we defined the loss function. In step 4, we used the mx.opt.create() function to create an optimizer by name and parameters. We created an adadelta optimizer and configured its parameters. The wd parameter is an L2 regularization ...
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.
Read now
Unlock full access