Reputation: 317
I fine tunes vgg-16 for binary classification. I used sigmoidLoss layer as the loss function.
To test the model, I coded a python file in which I loaded the model with an image and got the output using :
out = net.forward()
My doubt is should I take the output from Sigmoid or SigmoidLoss layer. And What is the difference between 2 layers.
My output will actually be the probability of input image being class 1.**
Upvotes: 2
Views: 335
Reputation: 26
For making predictions on test set, you can create a separate deploy prototxt by modifying the original prototxt.
Following are the steps for the same
You can read more about this here: deploy prototxt
Else, you can add
include {
phase: TRAIN
}
to your SigmoidWithLoss layer so that it's not used when testing the network. To make predictions, simply check the output of Sigmoid layer.
Upvotes: 1
Reputation: 114786
SigmoidWithLoss
layer outputs a single number per batch representing the loss w.r.t the ground truth labels.
On the other hand, Sigmoid
layer outputs a probability value for each input in the batch. This output does not require the ground truth labels to be computed.
If you are looking for the probability per input, you should be looking at the output of the Sigmoid
layer
Upvotes: 1