Dear K.Frank,
thank you so much for this extensive reply and all the explanations. That was massive help.
I have now fixed the accuracy calculation and changed my loss function to BCEWithLogitsLoss and got rid of the sigmoid in my network.
I’m still a bit confused though about how I should initialise my inputs, so that the normal distributions are not the same for y=0 and y=1.
This is what I did now, but the accuracy drops from 50% to 3% during the course of training:
x_m = torch.empty(10000,1, dtype=torch.float)
x_c = torch.empty(10000,1, dtype=torch.float)
for t in range(batchlen):
if y[t] == 0:
x_m[t] = torch.normal(-1, 1.3, size=(1,1))
x_c[t] = torch.normal(-1, 0.1, size=(1,1))
elif y[t] == 1:
x_m[t] = torch.normal(1, 1.3, size=(1,1))
x_c[t] = torch.normal(1, 0.1, size=(1,1))
Thank you so much! Really appreciate your help.