Python Pytorch model.load调用模糊性

Python Pytorch model.load调用模糊性,python,machine-learning,neural-network,model,pytorch,Python,Machine Learning,Neural Network,Model,Pytorch,简单一点: 这有什么用 model.load_state_dict({name : weights_before[name] + (weights_after[name] - weights_before[name]) * outerstepsize for name in weights_before}) 多谢各位 load\u state\u dict将可学习的参数从字典加载到神经网络中 每个层都有各自的名称和参数。在这种情况下,您将查看两个字典(wei

简单一点:

这有什么用

model.load_state_dict({name : 
        weights_before[name] + (weights_after[name] - weights_before[name]) * outerstepsize 
        for name in weights_before})

多谢各位

load\u state\u dict
将可学习的参数从字典加载到神经网络中

每个层都有各自的名称和参数。在这种情况下,您将查看两个字典(
weights\u before
weights\u before
),始终使用
weights\u before
,但另外,参数值之间的差值将乘以
outerstepsize

您可以在中查看更多信息