dragen1860 / MAML-Pytorch

Elegant PyTorch implementation of paper Model-Agnostic Meta-Learning (MAML)
MIT License
2.28k stars 421 forks source link

Some ideas about parameters updating. #47

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 using state_dict() and load_stat_dict() is much easier than modifying all the weights (in learner.py forward), can I first deepcopy the net parameters(state_dict()) and use the fast weights (also use a optimizer to update, instead of list(map(lambda p: p[1] - self.update_lr * p[0], zip(grad, self.net.parameters()))) ), then load the origin parameters back to update the meta learner? Thanks.

im-wll commented 4 years ago

I also think it's too complicated to redefine the initialization parameters for each layer. Is there any way to make any network (such as ResNet) put into the MAML frame without defining each layer?

shiliang26 commented 3 years ago

I wonder if anyone has successfully implemented this, as I haven't. It appears any load operation or attempt to backprop in an alternative network would remove the computational graph.

I have been relying on redefining every layer for deeper networks so it would really help if this works.