Giter VIP home page Giter VIP logo

domainbed_fmi's Introduction

Reproduce Results in the Paper

This repo is based on DomainBed and Invariance unit tests.

Installing requirements

conda create -n FMI python=3.9
conda activate FMI
pip install -r requirements.txt

Running experiments on Colored MNIST (requires cluster)

Please follow instructions given by DomainBed to download datasets.

cd path/to/this/repo/
export PYTHONPATH=path/to/this/repo
python -m domainbed.scripts.sweep launch\
       --data_dir=/my/datasets/path\
       --output_dir=/my/sweep/output/path\
       --command_launcher MyLauncher\
       --algorithms FMI --datasets ColoredMNIST\ 
       --n_hparams 1 --n_trial 10

After finishing the sweep, collect the result by running

python -m domainbed.scripts.collect_results\
       --input_dir=/my/sweep/output/path

Running unit tests

If one wants to run the sweep locally, use

cd path/to/this/repo
sh scripts_FMI/unit_tests/sweep.sh

If one is using a cluster, run

cd path/to/this/repo/
python scripts_unit_tests/sweep.py --num_iterations 10000 --num_data_seeds 50\ 
    --num_model_seed 20 --output_dir results/ --num_samples 1000

After finishing the sweep, collect the result by running

python scripts_unit_tests/collect_results.py results/COMMIT/

Plot attention maps

cd path/to/this/repo
python -m domainbed.attention.plot_attention --dataset ColoredMNIST\ 
    --data_dir domainbed/data/MNIST --model FMI --test_envs 2\ 
    --model_path scripts_FMI/model/model_ColoredMNIST_FMI.pkl --row 2 --col 2

domainbed_fmi's People

Contributors

lopezpaz avatar talhz avatar igul222 avatar jc-audet avatar gordon-guojun-zhang avatar shahtalebi avatar sirrob1997 avatar yugeten avatar aengusl avatar jean72human avatar mathieuchevalley avatar zdhnarsil avatar shakedpe avatar dnap512 avatar minhlong94 avatar alexrame avatar ashok-arjun avatar daysm avatar jungwon-choi avatar accumulated avatar mohomran avatar ryoungj avatar jpgard avatar m-just avatar prockenschaub avatar teeann avatar

Watchers

 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.