update:
I only added batch first and it works. But takes much longer. I provide the output below (got a bit better but still loss gets stuck).
Thank you for spotting this mistake.
Answering about the sizes:
X_batch shape is ([1, 129, 39])
y_batch is ([129])
in this line outputs = net(X_batch) the outputs size is torch.Size([1, 129, 2])
therefore
I have the next line outputs = outputs.view(batch_size,output_size) so that the shape is then torch.Size([129, 2]) so that it works for the loss function.
One column is for the class 0 and another for class 1 (their sum is 1). I understand that 1 column in this case would be enough to predict, but the Cross Entropy Loss function, that I use because I need to assign weights, requires such a shape of outputs…
So, after correcting the mistake that you spotted I have the following output
(weirdly only 4 epochs seems enough to stabilize that bad training loss):
Epoch [1] out of 5
Training loss: 0.591… Validation loss: 0.576…
PR AUC: 0.176
Epoch [2] out of 5
Training loss: 0.575… Validation loss: 0.573…
Epoch [3] out of 5
Training loss: 0.573… Validation loss: 0.572…
Epoch [4] out of 5
Training loss: 0.573… Validation loss: 0.571…
Epoch [5] out of 5
Training loss: 0.572… Validation loss: 0.571…
Finished Training
starttime = 2020-09-29 15:28:55.419550
now = 2020-09-29 18:00:04.417759