February 2018
Intermediate to advanced
262 pages
6h 59m
English
We defined a model that is a bit similar to the networks that we saw in Chapter 6, Deep Learning with Sequence Data and Text, but it has some key differences. The high-level architecture of the network looks like the following image:

As usual, let's take a look at the code and then walk through the key parts of it:
class RNNModel(nn.Module): def __init__(self,ntoken,ninp,nhid,nlayers,dropout=0.5,tie_weights=False): #ntoken represents the number of words in vocabulary. #ninp Embedding dimension for each word ,which is the input for the LSTM. #nlayer Number of layers required to be used in the LSTM . #Dropout ...
Read now
Unlock full access