From the Pytorch documentation, CrossEntropyLoss combines LogSoftMax and NLLLoss together in one single class
But I am curious; what happens if we use both CrossEntropyLoss for criterion and LogSoftMax in my classifier:
model_x.fc = nn.Sequential (nn.Linear(num_ftrs, 2048, bias=True), nn.ReLU(),
nn.Linear(2048, 1024 ), nn.ReLU(),
nn.Linear(1024 ,256), nn.ReLU(),
nn.Linear(256 ,128), nn.ReLU(),
nn.Linear(128, num_labels),nn.LogSoftmax(dim = 1))
criterion = nn.CrossEntropyLoss()
Then if i have saved a trained model using the code above, how can I check the criterion used by the saved model?