Experimenting with the maximum sequence length and the optimizer

Let's start by creating train and test data for the sequence of integers representing movie reviews and their labels using the following code:

c(c(train_x, train_y), c(test_x, test_y)) %<-% imdbz <- NULLfor (i in 1:25000) {z[i] <- print(length(train_x[[i]]))}summary(z)   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    11.0   130.0   178.0   238.7   291.0  2494.0 

In the preceding code, we're storing the length of the sequences based on the training data in z. By doing this, we get a summary of z. From here, we can obtain numeric summary values such as the minimum, first quartile, median, mean, third quartile, and maximum. The median value for the sequence of words is 178. In the previous sections, ...

Get Advanced Deep Learning with R now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.