Dear @ptrblck, I have one more question. After the using sigmoid layer like below:

class Net(nn.Module):
def init(self):
super(Net, self).init()
self.pool = nn.MaxPool2d(2, 2)
self.conv1 = nn.Conv2d(3, 10, 5)
self.conv2 = nn.Conv2d(10, 20, 5)
self.fc1 = nn.Linear(20 * 5 * 5, 256)
self.fc2 = nn.Linear(256, 1)


def forward(self, x):
# print x.size()
x = self.pool(F.relu(self.conv1(x)))
x = self.pool(F.relu(self.conv2(x)))
x = x.view(-1, 2055) # flatten the sensor
x = F.relu(self.fc1(x))
x = self.fc2(x)
return F.sigmoid(x)
How can I determine the output label?

I mean, After the image pass the network, the output become a value between [0 1]. And how can I determine the existence of the object in the image. For example, Should I choose a threshold value such as 0.5?