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

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.1.3.tar.gz (5.9 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.1.3-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: MetaNN-0.1.3.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.1.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.0

File hashes

Hashes for MetaNN-0.1.3.tar.gz
Algorithm Hash digest
SHA256 bbfa80ae4f8fc1b3aa38d2b75c0e89485f920cf9f4c54c9e23bbd8270fe46f10
MD5 0ea86c208df5637bd50a104219283d62
BLAKE2b-256 47cfed8d96cf83df1280a4187143a2c18941696b35b41dd47cb374367f60399a

See more details on using hashes here.

File details

Details for the file MetaNN-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: MetaNN-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.1.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.0

File hashes

Hashes for MetaNN-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 2850fa4464a91eed0a2e047d6b9b32892eac90e98cedb2f0f1416a486e450561
MD5 bd67d16efc81877bd7c1b6d57e4c17f7
BLAKE2b-256 16c7929b7bfc79521ade88d3a39ba2800b8af5522d13372b6e2b80a2be6dada2

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