AllanYangZhou / metalearning-symmetries

Experiments for Meta-Learning Symmetries by Reparameterization
56 stars 7 forks source link

Meta-learning Symmetries by Reparameterization (MSR)

Code and weights corresponding to Meta-learning Symmetries by Reparameterization, found at this arXiv link.

Installation and requirements

All experiments were run in a conda environment with python 3.7.5, using pytorch. The conda environment we used is exported in environment.yml, though it likely contains more packages than are strictly necessary.

Synthetic experiments

Generate data

The file generate_synthetic_data.py contains the data generation code. You must specify the name of the problem we wish to generate data for. Options are:

Example:

python generate_synthetic_data.py --problem rank1

Train

The file train_synthetic.py contains training and evaluation code. Specifying the argument model controls whether to use MSR, plain MAML, or something else.

Some examples are given below:

python train_synthetic.py --problem rank1 --model share_fc  # MSR+FC on rank1 problem.
python train_synthetic.py --problem rank1 --model fc  # MAML+FC on rank1 problem.
python train_synthetic.py --problem rank1 --model conv  # MAML+Conv model on rank1 problem.
python train_synthetic.py --problem 2d_rot8 --model share_conv  # MSR+Conv on 2d_rot8 problem.
python train_synthetic.py --problem 2d_rot8 --model conv  # MAML+Conv on 2d_rot8 problem.

Augmented-(Omniglot/Miniimagenet)

WIP