iteryne
Model-Agnostic Meta-Learning (MAML) for any PyTorch nn.Module.
iteryne implements MAML
(Finn, Abbeel & Levine, 2017) on top of
PyTorch's native torch.func. It meta-trains a model's initial parameters so
that a few gradient steps on a new task's small support set generalize to that
task's query set.
Why iteryne
- Model-agnostic. Works on any
nn.Module(MLP, CNN, BatchNorm, ...) with no rewriting, viatorch.func.functional_call. - First- and second-order. Full MAML and FOMAML share one code path; flip a
single
first_orderflag. - Variants. Meta-SGD (learnable per-parameter inner learning rates) and ANIL (adapt only the head) ship in the box.
- Two API levels. A high-level
MAMLwrapper plusMetaTrainer, and an exposed functional core.
Install
pip install iteryne
Requires Python >= 3.10 and PyTorch >= 2.1.
Continue to the Quickstart.