user1354917
user1354917

Reputation: 77

Pytorch model.load call ambiguity

Simple one:

what does this do?

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

Thank you very much!

Upvotes: 0

Views: 19

Answers (1)

Szymon Maszke
Szymon Maszke

Reputation: 24884

load_state_dict loads learnable parameters into neural network from dictionary.

Each layer has it's respective name and parameters. In this case you go over two dictionaries (weights_before and weights_after), weights_after are always used, but additionally the difference between parameter values are added multiplied by outerstepsize.

You can check out more in PyTorch docs.

Upvotes: 1

Related Questions