8000 GitHub - erobic/MetaNN: MetaModule provides extensions of PyTorch Module for meta learning
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

erobic/MetaNN

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MetaNN for PyTorch Meta Learning

1. Introduction

In meta learner scenario, it is common use dependent variables as parameters, and back propagate the gradient of the parameters. However, parameters of PyTorch Module are designed to be leaf nodes and it is forbidden for parameters to have grad_fn. Meta learning coders are therefore forced to rewrite the basic layers to adapt the meta learning requirements.

This module provide an extension of torch.nn.Module, DependentModule that has dependent parameters, allowing the differentiable dependent parameters. It also provide the method to transform nn.Module into DependentModule, and turning all of the parameters of a nn.Module into dependent parameters.

2. Installation

pip install MetaNN

3. Example

from metann import DependentModule, Learner
from torch import nn
net = torch.nn.Sequential(
    nn.Linear(10, 100),
    nn.Linear(100, 5))
net = DependentModule(net)
print(net)

4. Documents

MetaNN

This won't build correctly with the heavy dependency PyTorch, so I updated the sphinx built html to GitHub. I hate to use mock to solve This problem, I suggest you to clone the repository and view the html docs yourself.

5. License

MIT

Copyright (c) 2019-present, Hanqiao Yu

About

MetaModule provides extensions of PyTorch Module for meta learning

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%
0