I’m trying to train an lstm using pre-trained word2vec vectors as input. The lstm is meant to  generate a sequence given the first vector. I have been able to do this by passing the hidden state to the fully connected layer when the FC’s output_features have a dimensionality the size of the length of my vocabulary, and thus the lstm works as a classifier, but I what I want is for the lstm to output a vector with the same dimensions as the pretrained input vectors, so I can then call similar_by_vector and get the nearest word in the vocabulary. I don’t know if in this case it is advisable to use nn.Linear as the fully connected layer. It currently looks like this:
nn.Linear(in_features = self.cfg.lstm.lstm_num_hidden, out_features =self.cfg.lstm.embedding_dim, bias=True)
Is this enough to produce a word2vec vector as output (or at least something close to it)?
Any advice would be much appreciated.