Hi, I’m using an LSTM for image captioning with packed inputs (see the snippet below) and I wondered what is the proper way of testing it. Can I just set the model to eval and feed it the test set or should I write a custom sampling? I’m asking because I’m not sure how information is passed between hidden states when using packed inputs and I was wondering if it does “teacher forcing” (i.e. pass the target instead of the prediction) which would be a problem when testing.
def forward(self, features, tags, lengths):
        embeddings = self.embed(tags)
        embeddings = torch.cat((features.unsqueeze(1), embeddings), 1)
        packed = pack_padded_sequence(embeddings, (lengths).numpy(), batch_first=True) 
        hiddens, _ = self.lstm(packed)
        outputs = self.linear(hiddens[0])
        return outputs