I am new to PyTorch. I set the requires_grade for the features extraction layers of vgg16 to false (as I want to freeze these layers for fine tuneing the model) using following code:
for name, param in model.named_parameters():
if param.requires_grad and ‘features’ in name:
param.requires_grad = False
Is it the correct way of freezing some of the network’s layers? Also is there any way to confirm that the weights and biases are not being updated in the frozen part of the network?