On line 138 : state_dictForLayer23={k: v for k, v in netForFeatureExtractionLayer23Dict.items() if k in state_dictForLayer23}
netForFeatureExtractionLayer23Dict.items() seems to be a dictionary of randomly initialized parameters, while state_dictForLayer23 is the real pretrained_model. "for k, v in netF...items()" retains the weight in the random parameter.
So this line of code seems to just load random parameters into the network.
Nevertheless, thank you very much for migrating the code in matlab to the python version for us to learn.
On line 138 : state_dictForLayer23={k: v for k, v in netForFeatureExtractionLayer23Dict.items() if k in state_dictForLayer23} netForFeatureExtractionLayer23Dict.items() seems to be a dictionary of randomly initialized parameters, while state_dictForLayer23 is the real pretrained_model. "for k, v in netF...items()" retains the weight in the random parameter. So this line of code seems to just load random parameters into the network. Nevertheless, thank you very much for migrating the code in matlab to the python version for us to learn.