- Python 3.7
- Pytorch 1.7
- CUDA 10
Git clone the repo:
git clone git@github.com:ebennequin/meta-domain-shift.git
Then cd meta-domain-shift
and create a virtual environment (if you don't already have it,
use pip install virtualenv
):
virtualenv venv --python=python3.7
source venv/bin/activate
Then install dependencies: pip install -r requirements.txt
Some perturbations used in CIFAR-100-C-FewShot and miniImageNet-C use Wand: sudo apt-get install libmagickwand-dev
To install the datasets to your machine, please follow this walkthrough.
Configure your experiment by changing the values in configs/*.py
, then launch your experiment.
python -m scripts.run_experiment
On some machines, the src
module will not be found by Python. If this happens to you, run
export PYTHONPATH=$PYTHONPATH:path/to/meta-domain-shift
to tell Python where you're at.
All outputs of the experiment (explicit configuration, logs, trained model state and TensorBoard logs)
can then be found in the directory specified in configs/experiment_config.py
. By default, an error will be risen if
the specified directory already exists (in order to not harm the results of previous experiments). You may
change this behaviour in configs/experiment_config.py
by setting OVERWRITE = True
.
See the detailed documentation here.
We log the loss and validation accuracy during the training for visualization in Tensorboard. The logs of an
experiment can be found in the output directory (events.out.tfevents.[...]
). To visualize them in Tensorboard, run:
tensorboard --logdir=output_dir
- Make sure you start from an up to date
master
branchgit checkout master && git pull
- Create a new branch
git checkout -b my-branch
- Add your changes
git add -p
- Commit your changes
git commit -m "Add FEMNIST dataset"
- Push your changes to the
origin
remotegit push --set-upstream origin my-branch
- Open a pull request on GitHub and ask a teammate to review your code
- Once reviewed, merge your branch to master
If your changes to the code need a new library (not in the requirements), please add it to requirements.txt
Meta-learning code is modified from https://github.com/sicara/FewShotLearning Image perturbations are modified from https://github.com/hendrycks/robustness