katerakelly / pytorch-maml

PyTorch implementation of MAML: https://arxiv.org/abs/1703.03400
MIT License
553 stars 129 forks source link

About the Model parameters updating in OmniglotNet Class #21

Open zhaoyu-li opened 4 years ago

zhaoyu-li commented 4 years ago

Thanks for your good implementation of MAML, however, I think that maybe use state_dict() and load_stat_dict() is much faster than modifying the weights (in omniglot_net.py 43), can I first deepcopy the net parameters(state_dict()) and use the fast weights (also use a optimizer to update), then load the origin parameters back to update the meta learner? Thanks.

yucaodie commented 4 years ago

I also wanted to do that ,but the grad can not backword and parameters cannot update. is the most important that to share grad between two models??