mrnet
mrnet copied to clipboard
Seems that "Softmax" should be used instead of "Sigmoid"?
Hello, thanks for your implementation. However, I found that the "probs" for binary classification doesn't sum up to be 1.0.
prediction = model.forward(image.float())
loss = torch.nn.BCEWithLogitsLoss(weight=weight)(prediction, label)
loss.backward()
optimizer.step()
loss_value = loss.item()
losses.append(loss_value)
probas = torch.sigmoid(prediction)
y_trues.append(int(label[0][1]))
y_preds.append(probas[0][1].item())
The issue mentioned is located in "https://github.com/ahmedbesbes/mrnet/blob/master/train.py"