Thanks for that detailed answer! Its exactly what I’m trying to do. Here’s my code:
criterion = nn.BCEWithLogitsLoss()

for image_batch, label_batch in val_dl:
  image_batch, label_batch = image_batch.to(DEVICE), label_batch.to(DEVICE)

  pred_batch = model(image_batch)
  label_batch = label_batch.view(-1, 1)
  batch_loss = criterion(pred_batch.double(), label_batch.double())
  total_val_loss += batch_loss.item()

Here the pred_batch output:
[ [-0.7402], [-1.0285], [-0.7212], [-0.6358], [-0.4438], [-0.8488]...]
From here do I have to use sigmoid to get 0/1?