Skip to main content

MetaNN provides extensions of PyTorch nn.Module for meta learning

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

MetaNN-0.2.7.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

MetaNN-0.2.7-py3.7.egg (21.2 kB view details)

Uploaded Egg

File details

Details for the file MetaNN-0.2.7.tar.gz.

File metadata

  • Download URL: MetaNN-0.2.7.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/56.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.6

File hashes

Hashes for MetaNN-0.2.7.tar.gz
Algorithm Hash digest
SHA256 e0b396b61557803fe2a982a6e55be9c46df37d894d52887daa7495911a3938ae
MD5 c58ab55a655a5955a9abe5537a0455ee
BLAKE2b-256 1e5bff1ac3f29efe216c6e8e07b0bb78468998ab5acda1828c8b7d470b637abe

See more details on using hashes here.

File details

Details for the file MetaNN-0.2.7-py3.7.egg.

File metadata

  • Download URL: MetaNN-0.2.7-py3.7.egg
  • Upload date:
  • Size: 21.2 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/56.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.6

File hashes

Hashes for MetaNN-0.2.7-py3.7.egg
Algorithm Hash digest
SHA256 86a9e444c2a5f7a4986491abecdcf2e5245b1ec0759c0bd09268113b81feac44
MD5 42c3e5eaebb70773957764a9440744be
BLAKE2b-256 e3fea2c11200275db33c2455b9b08d44fa4404974e76229997c9dcf5b44d0734

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page