ptrblck:

You don’t need to use torch.exp , if you’ve used F.sigmoid in your model.
Also, you should use a threshold on the probabilities to get the corresponding class, e.g. 0.5 .
tensor.topk will return a zero tensor in your current setup


Thank you very much. That pretty much does it. The net trains and gives reasonable results.

But the accuracy is wiggling vigorously, looks like a zigzag.

I tried changing the learning rate  and the batch size (now 1000) but it still outputs a zigzag. And calculating ROC_AUC is not very effective.