The way I think of is,
output = torch.sigmoid(output)
if 0 =< output < 0.5:
    # prediction is label 0
else:
    # prediction is label 1

But this makes

get value of loss by output data

get value of accuracy by torch.sigmoid(output data)


Can I do like this? Does it mean get value of loss and accuracy by different data, so it’s not in line with mathematical logic?