Sam_Shamsan:

      batch_X= F.relu(batch_X)


You shouldn’t b using relu here.



 Sam_Shamsan:

        model.zero_grad()


this shouldn’t be required.



 Sam_Shamsan:

        output = model.forward(batch_X)


Instead use output = model(batch_X)



 Sam_Shamsan:

        batch_y = torch.autograd.Variable(batch_y)


This may not be required.



 Sam_Shamsan:

loss_fn = torch.nn.BCELoss()


You might need torch.nn.BCEWithLogitsLoss() depending on what the output of your model is like.