-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5236858
commit b83a37d
Showing
1 changed file
with
44 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,44 @@ | ||
# pytorch-maml | ||
Model-Agnostic Meta-Learning in Pytorch | ||
# Model-Agnostic Meta-Learning | ||
|
||
An implementation of Model-Agnostic Meta-Learning (MAML) in [PyTorch](https://pytorch.org/) with [Torchmeta](https://github.com/tristandeleu/pytorch-meta). | ||
|
||
### Getting started | ||
To avoid any conflict with your existing Python setup, it is suggested to work in a virtual environment with [`virtualenv`](https://docs.python-guide.org/dev/virtualenvs/). To install `virtualenv`: | ||
```bash | ||
pip install --upgrade virtualenv | ||
``` | ||
Create a virtual environment, activate it and install the requirements in [`requirements.txt`](requirements.txt). | ||
```bash | ||
virtualenv venv | ||
source venv/bin/activate | ||
pip install -r requirements.txt | ||
``` | ||
|
||
#### Requirements | ||
- Python 3.5 or above | ||
- PyTorch 1.2 | ||
- Torchvision 0.4 | ||
- Torchmeta 1.1 | ||
|
||
### Usage | ||
You can use [`train.py`](train.py) to meta-train your model with MAML. For example, to run MAML on Omniglot 1-shot 5-way with default parameters from the original paper: | ||
```bash | ||
python train.py /path/to/data --dataset omniglot --num-ways 5 --num-shots 1 --use-cuda --step-size 0.4 --batch-size 32 --num-workers 8 --num-epochs 600 | ||
``` | ||
|
||
|
||
### References | ||
The code available in this repository is mainly based on the paper | ||
> Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep | ||
networks. _International Conference on Machine Learning (ICML)_, 2017 [[ArXiv](https://arxiv.org/abs/1703.03400)] | ||
|
||
If you want to cite this paper | ||
``` | ||
@article{finn17maml, | ||
author = {Chelsea Finn and Pieter Abbeel and Sergey Levine}, | ||
title = {Model-{A}gnostic {M}eta-{L}earning for {F}ast {A}daptation of {D}eep {N}etworks}, | ||
journal = {International Conference on Machine Learning (ICML)}, | ||
year = {2017}, | ||
url = {https://arxiv.org/abs/1703.03400} | ||
} | ||
``` |