Don’t apply torch.sigmoid on your model output before passing it to nn.CrossEntroptyLoss, as raw logits are expected.
You also don’t need the sigmoid when computing train_pred, as torch.argmax(train_output, dim=1) will already give you the predicted classes.