Thank you @ptrblck. A few follow up questions referring to the following code snippet
    def forward(self, input_):
        lstm_out, (h, c) = self.lstm(input_)
        logits = self.fc(lstm_out[-1])
        scores = F.sigmoid(logits)
        return scores


lstm_out[:, -1] would be the same as h[-1]? I checked it with torch.equal(lstm_out[:, -1], h[-1]) and it is True. Just want to confirm.
Since I’m using BCEWithLogitsLoss, do I need to have the sigmoid activation at the end of the model as BCEWithLogitsLoss has in-built sigmoid activation ?
2.1. Only during prediction phase, I need to have a sigmoid activation for classification, as following ?


def binary_acc(y_pred, y_test):
    y_pred_tag = torch.round(torch.sigmoid(y_pred))

    correct_results_sum = (y_pred_tag == y_test).sum().float()
    acc = correct_results_sum/y_test.shape[0]
    acc = torch.round(acc * 100)
    
    return acc