GithubHelp home page GithubHelp logo

renovamen / metallic Goto Github PK

View Code? Open in Web Editor NEW
7.0 3.0 0.0 265 KB

A clean, lightweight and modularized PyTorch meta-learning library.

Home Page: https://metallic-docs.vercel.app

License: MIT License

Python 100.00%
meta-learning pytorch maml learning-to-learn few-shot-learning reptile

metallic's Introduction

Metallic

Metallic is a meta-learning library based on PyTorch.

Different from other meta-learning libraries, Metallic tries to:

  • Provide a clean, lightweight and modularized toolbox for setting up meta-learning experiments quickly with the least amount of code.
  • For gradient-based meta-learning methods (like MAML), support more optimizers instead of SGD only using higher.

The library is work in progress.

 

Features

Algorithms

The supported interface algorithms currently include:

Gradient-based

Metric-based

Datasets

The supported datasets currently include:

 

Installation

git clone https://github.com/Renovamen/metallic.git
cd metallic
python setup.py install

or

pip install git+https://github.com/Renovamen/metallic.git --upgrade

 

Documentations

Check the API documentation here: metallic-docs.vercel.app

 

Acknowledgements

Metallic is highly inspired by the following awesome libraries:

 

License

Metallic is MIT licensed, see the LICENSE file for more details.

metallic's People

Contributors

renovamen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

metallic's Issues

MAML or FOMAML implement

in the maml.py you compute the grad manully and map the grad from higher to the original model. but you only use the grad[-1] to the original model. is it works well?

                if meta_train == True:
                    # query_loss.backward()
                    outer_grad = torch.autograd.grad(query_loss / n_tasks, fmodel.parameters(time=0))
                    grad_list.append(outer_grad)

        # When in the meta-training stage, update the model's meta-parameters to
        # optimize the query losses across all of the tasks sampled in this batch.
        if meta_train == True:
            # apply gradients to the original model parameters
            apply_grads(self.model, grad_list[-1])                                      ---- about this line.
            # outer loop update

also in reptile.py

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.