Solved by crcrpar in post #2 
              
              
                I assume that the task is binary classification, then I would use nn.BCELoss, set self.lin1 as nn.Linear(4, 1), and classes as 0 or 1, not -1 or 1.