python - Accessing PyTorch modules - ResNet18 - Stack Overflow
https://stackoverflow.com/questions/6724321824.04.2021 · In order to prune this model, I am referring to PyTorch pruning tutorial. It's mentioned here that to prune a module/layer, use the following code: parameters_to_prune = ( (model.conv1, 'weight'), (model.conv2, 'weight'), (model.fc1, 'weight'), (model.fc2, 'weight'), (model.fc3, 'weight'), ) But for the code above, the modules/layers no longer ...
Weight initilzation - PyTorch Forums
https://discuss.pytorch.org/t/weight-initilzation/15723.01.2017 · How to fix/define the initialization weights/seed. Atcold (Alfredo Canziani) January 23, 2017, 11:36pm #2. Hi @Hamid, I think you can extract the network’s parameters params = list (net.parameters ()) and then apply the initialisation you may like. If you need to apply the initialisation to a specific module, say conv1, you can extract the ...