My loss function is:
def loss_fn(inp, target):
    zeros_sum = (target == 0).sum(dim = 0).float()
    one_sum = (target == 1).sum(dim = 0).float()

    pos_weight = zeros_sum / (one_sum + 1e-2)
    loss_fn = torch.nn.BCEWithLogitsLoss(reduction='mean', pos_weight=pos_weight)

    loss = loss_fn(inp, target)

    return loss

When passing to my model, I’m passing in the result of a convolution and no Sigmoid activation:
            pred = model(inputs)
            
            loss = loss_fn(pred, outputs)

So then why does my pred have negative values? I thought Sigmoid squashes between 0 and 1?