recurrent neural networks listing - defining the rnn class class rnnmodel(nn module)def __init__(self,embedding_dim,input_dim,hidden_dimoutput_dim)super(__init__(self embedding nn embedding(input_dim,embedding_dimself rnn nn rnn(embedding_dim,hidden_dimself fc nn linear(hidden_dim,output_dimdef forward(self,text)embed self embedding(textoutputhidden self rnn(embedout self fc(hidden squeeze( )return(out#define model input_dim len(text vocabembedding_dim hidden_dim output_dim #create model instance model rnnmodel(embedding_diminput_dim,hidden_dimoutput_dima significant portion of this code is very comparable to our experiments in and the new additions here are the embedding layer and the rnn layer the rnn layer returns the output as well as the hidden layer computation (unlike the other layers we've explored so farthe input dimension is the length of our vocab list the embedding dimension is value that we decide would best represent word numerically we use herebut it could be or higher