Giter Club home page Giter Club logo

mmaml-regression's Introduction

Multimodal Model-Agnostic Meta-Learning for Few-shot Regression

This project is an implementation of Multimodal Model-Agnostic Meta-Learning via Task-Aware Modulation, which is published in NeurIPS 2019. Please visit our project page for more information and contact Hexiang Hu for any questions.

Model-agnostic meta-learners aim to acquire meta-prior parameters from a distribution of tasks and adapt to novel tasks with few gradient updates. Yet, seeking a common initialization shared across the entire task distribution substantially limits the diversity of the task distributions that they are able to learn from. We propose a multimodal MAML (MMAML) framework, which is able to modulate its meta-learned prior according to the identified mode, allowing more efficient fast adaptation. An illustration of the proposed framework is as follows.

Getting started

Use of Conda Environment is suggested to for straightforward handling of the dependencies.

conda env create -f environment.yml
conda activate mmaml_regression

Usage

After installation, we can start to train models with the following commands.

Linear + Sinusoid Functions

MAML

python main.py --dataset mixed --num-batches 70000 --model-type fc --fast-lr 0.001 --meta-batch-size 50 --num-samples-per-class 10 --num-val-samples 5 --noise-std 0.3 --hidden-sizes 100 100 100 --device cuda --num-updates 5 --output-folder 2mods-maml-5steps --bias-transformation-size 20 --disable-norm

Multi-MAML

python main.py --dataset mixed --num-batches 70000 --model-type multi --fast-lr 0.001 --meta-batch-size 50 --num-samples-per-class 10 --num-val-samples 5 --noise-std 0.3 --hidden-sizes 100 100 100 --device cuda --num-updates 5 --output-folder 2mods-multi-maml-5steps --bias-transformation-size 20 --disable-norm

MMAML-postupdate

FiLM

python main.py --dataset mixed --num-batches 70000 --model-type gated --fast-lr 0.001 --meta-batch-size 50 --num-samples-per-class 10 --num-val-samples 5 --noise-std 0.3 --hidden-sizes 100 100 100 --device cuda --num-updates 5 --output-folder 2mods-mmaml-5steps --bias-transformation-size 20 --disable-norm --embedding-type LSTM --embedding-dims 200  --inner-loop-grad-clip 10

Sigmoid

python main.py --dataset mixed --num-batches 70000 --model-type gated --fast-lr 0.001 --meta-batch-size 50 --num-samples-per-class 10 --num-val-samples 5 --noise-std 0.3 --hidden-sizes 100 100 100 --device cuda --num-updates 5 --output-folder 2mods-mmaml-sigmoid-5steps --bias-transformation-size 20 --disable-norm --embedding-type LSTM --embedding-dims 100  --inner-loop-grad-clip 10 --condition-type sigmoid_gate

Softmax

python main.py --dataset mixed --num-batches 70000 --model-type gated --fast-lr 0.001 --meta-batch-size 50 --num-samples-per-class 10 --num-val-samples 5 --noise-std 0.3 --hidden-sizes 100 100 100 --device cuda --num-updates 5 --output-folder 2mods-mmaml-softmax-5steps --bias-transformation-size 20 --disable-norm --embedding-type LSTM --embedding-dims 100  --inner-loop-grad-clip 10 --condition-type softmax

MMAML-preupdate

python main.py --dataset mixed --num-batches 70000 --model-type gated --fast-lr 0.0 --meta-batch-size 50 --num-samples-per-class 10 --num-val-samples 5 --noise-std 0.3 --hidden-sizes 100 100 100 --device cuda --num-updates 1 --output-folder 2mods-mmaml-pre-1steps --bias-transformation-size 20 --disable-norm --embedding-type LSTM --embedding-dims 100  --inner-loop-grad-clip 10

Linear + Quadratic + Sinusoid Functions

MAML

python main.py --dataset many --num-batches 70000 --model-type fc --fast-lr 0.001 --meta-batch-size 75 --num-samples-per-class 10 --num-val-samples 5 --noise-std 0.3 --hidden-sizes 100 100 100 --device cuda --num-updates 5 --output-folder 3mods-maml-5steps --bias-transformation-size 20 --disable-norm

Multi-MAML

python main.py --dataset many --num-batches 70000 --model-type multi --fast-lr 0.001 --meta-batch-size 75 --num-samples-per-class 10 --num-val-samples 5 --noise-std 0.3 --hidden-sizes 100 100 100 --device cuda --num-updates 5 --output-folder 3mods-multi-maml-5steps --bias-transformation-size 20 --disable-norm

MMAML-postupdate

FiLM

python main.py --dataset many --num-batches 70000 --model-type gated --fast-lr 0.001 --meta-batch-size 75 --num-samples-per-class 10 --num-val-samples 5 --noise-std 0.3 --hidden-sizes 100 100 100 --device cuda --num-updates 5 --output-folder 3mods-mmaml-5steps --bias-transformation-size 20 --disable-norm --embedding-type LSTM --embedding-dims 200 200 200 --inner-loop-grad-clip 10

Sigmoid

python main.py --dataset many --num-batches 70000 --model-type gated --fast-lr 0.001 --meta-batch-size 75 --num-samples-per-class 10 --num-val-samples 5 --noise-std 0.3 --hidden-sizes 100 100 100 --device cuda --num-updates 5 --output-folder 3mods-mmaml-sigmoid-5steps --bias-transformation-size 20 --disable-norm --embedding-type LSTM --embedding-dims 100 100 100 --inner-loop-grad-clip 10 --condition-type sigmoid_gate

Softmax

python main.py --dataset many --num-batches 70000 --model-type gated --fast-lr 0.001 --meta-batch-size 75 --num-samples-per-class 10 --num-val-samples 5 --noise-std 0.3 --hidden-sizes 100 100 100 --device cuda --num-updates 5 --output-folder 3mods-mmaml-softmax-5steps --bias-transformation-size 20 --disable-norm --embedding-type LSTM --embedding-dims 100 100 100 --inner-loop-grad-clip 10 --condition-type softmax

MMAML-preupdate

python main.py --dataset many --num-batches 70000 --model-type gated --fast-lr 0.00 --meta-batch-size 75 --num-samples-per-class 10 --num-val-samples 5 --noise-std 0.3 --hidden-sizes 100 100 100 --device cuda --num-updates 1 --output-folder 3mods-mmaml-pre-5steps --bias-transformation-size 20 --disable-norm --embedding-type LSTM --embedding-dims 200 200 200  --inner-loop-grad-clip 10

Linear + Quadratic + Sinusoid + Tanh + Absolute Functions

MAML

python main.py --dataset five --num-batches 70000 --model-type fc --fast-lr 0.001 --meta-batch-size 125 --num-samples-per-class 10 --num-val-samples 5 --noise-std 0.3 --hidden-sizes 100 100 100 --device cuda --num-updates 5 --output-folder 5mods-maml-5steps --bias-transformation-size 20 --disable-norm

Multi-MAML

python main.py --dataset five --num-batches 70000 --model-type multi --fast-lr 0.001 --meta-batch-size 125 --num-samples-per-class 10 --num-val-samples 5 --noise-std 0.3 --hidden-sizes 100 100 100 --device cuda --num-updates 5 --output-folder 5mods-multi-maml-5steps --bias-transformation-size 20 --disable-norm

MMAML-postupdate

FiLM

python main.py --dataset five --num-batches 70000 --model-type gated --fast-lr 0.001 --meta-batch-size 125 --num-samples-per-class 10 --num-val-samples 5 --noise-std 0.3 --hidden-sizes 100 100 100 --device cuda --num-updates 5 --output-folder 5mods-mmaml-5steps --bias-transformation-size 20 --disable-norm --embedding-type LSTM --embedding-dims 200 200 200  --inner-loop-grad-clip 10

Sigmoid

python main.py --dataset five --num-batches 70000 --model-type gated --fast-lr 0.001 --meta-batch-size 125 --num-samples-per-class 10 --num-val-samples 5 --noise-std 0.3 --hidden-sizes 100 100 100 --device cuda --num-updates 5 --output-folder 3mods-mmaml-sigmoid-5steps --bias-transformation-size 20 --disable-norm --embedding-type LSTM --embedding-dims 100 100 100  --inner-loop-grad-clip 10 --condition-type sigmoid_gate

Softmax

python main.py --dataset five --num-batches 70000 --model-type gated --fast-lr 0.001 --meta-batch-size 125 --num-samples-per-class 10 --num-val-samples 5 --noise-std 0.3 --hidden-sizes 100 100 100 --device cuda --num-updates 5 --output-folder 3mods-mmaml-softmax-5steps --bias-transformation-size 20 --disable-norm --embedding-type LSTM --embedding-dims 100 100 100  --inner-loop-grad-clip 10 --condition-type softmax

MMAML-preupdate

python main.py --dataset five --num-batches 70000 --model-type gated --fast-lr 0.00 --meta-batch-size 125 --num-samples-per-class 10 --num-val-samples 5 --noise-std 0.3 --hidden-sizes 100 100 100 --device cuda --num-updates 1 --output-folder 5mods-mmaml-pre-5steps --bias-transformation-size 20 --disable-norm --embedding-type LSTM --embedding-dims 200 200 200  --inner-loop-grad-clip 10

Authors

Hexiang Hu, Shao-Hua Sun, Risto Vuorio

mmaml-regression's People

Contributors

amrmkayid avatar vuoristo avatar atharva-tendle avatar

Watchers

James Cloos avatar

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.