Skip to content

Seems that "Softmax" should be used instead of "Sigmoid"? #5

@ABC67876

Description

@ABC67876

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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions