recurrent neural networks listing - defining the model properties and copying the pretrained weights #define model input parameters input_dim len(text vocabembedding_dim hidden_dim output_dim n_layers bidirectional true dropout #create model instance model improvedrnn(input_dimembedding_dimhidden_dimoutput_dimn_layersbidirectionaldropoutpad_idx#copy pretrained vector weights model embedding weight data copy_(pretrained_embeddings#initialize the embedding with for pad as well as unknown tokens unk_idx text vocab stoi[text unk_tokenmodel embedding weight data[unk_idxtorch zeros(embedding_dimpad_idx text vocab stoi[text pad_tokenmodel embedding weight data[pad_idxtorch zeros(embedding_dimprint(model embedding weight data