Hi,
I did a small experiment with the ShuffleNetV2 model, but I’m not sure about its results.
From the torchvision models, I loaded aShuffleNetV2 instance pretrained on ImageNet. So I have a classification network across 1000 classes, right?
Then, I replaced the last FC layer:
model.fc = Linear(in_features=model.fc.in_features, out_features=1, bias=(model.fc.bias is not None))
Also I called reset_parameters() on all layers.
So now, supposedly, I have a random network for binary classification, right? So its output should vary between 0 and 1.
But no. I figured that since the classification network probably has a softmax operator after the FC layer, then for a single output, I will got constantly 1.
Then I tested my hypothesis with random inputs, and as results I get negative values!
model(torch.randn(1,3,300,300))
Out[310]: tensor([[-0.0318]], grad_fn=<AddmmBackward>)

How can it be?