GithubHelp home page GithubHelp logo

dg_mmld's Introduction

Domain Generalization Using a Mixture of Multiple Latent Domains

model This is the pytorch implementation of the AAAI 2020 poster paper "Domain Generalization Using a Mixture of Multiple Latent Domains".

Requirements

  • A Python install version 3.6
  • A PyTorch and torchvision installation version 0.4.1 and 0.2.1, respectively. pytorch.org
  • The caffe model we used for AlexNet
  • PACS dataset (website, dateset)
  • Install python requirements
pip install -r requirements.txt

Training and Testing

You can train the model using the following command.

cd script
bash general.sh

If you want to train the model without domain generalization (Deep All), you can also use the following command.

cd script
bash deepall.sh

You can set the correct parameter.

  • --data-root: the dataset folder path
  • --save-root: the folder path for saving the results
  • --gpu: the gpu id to run experiments

Citation

If you use this code, please cite the following paper:

Toshihiko Matsuura and Tatsuya Harada. Domain Generalization Using a Mixture of Multiple Latent Domains. In AAAI, 2020.

@InProceedings{dg_mmld,
  title={Domain Generalization Using a Mixture of Multiple Latent Domains},
  author={Toshihiko Matsuura and Tatsuya Harada},
  booktitle={AAAI},
  year={2020},
  }

dg_mmld's People

Contributors

toshihiko-matsuura avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dg_mmld's Issues

_pickle.UnpicklingError: invalid load key, '<'

HI @milhidaka I am getting the following error
Traceback (most recent call last):
File "../main/main.py", line 90, in
num_classes=source_train.dataset.dataset.num_class, num_domains=disc_dim, pretrained=True)
File "../util/util.py", line 72, in get_network_fn
return nets_map[name]train
File "../model/caffenet.py", line 66, in caffenet
state_dict = torch.load("alexnet_caffe.pth.tar", map_location=lambda storage, loc: storage, pickle_module=pickle)
File "/home/vinodkk/miniconda2/envs/dg/lib/python3.6/site-packages/torch/serialization.py", line 358, in load
return _load(f, map_location, pickle_module)
File "/home/vinodkk/miniconda2/envs/dg/lib/python3.6/site-packages/torch/serialization.py", line 532, in _load
magic_number = pickle_module.load(f)
_pickle.UnpicklingError: invalid load key, '<'.
PACS/default/art1
path ../../../../../dataset/result/dg_mmld/PACS/default/art1


Source domain: photo, cartoon, sketch, Target domain: art_painting
Train: 7148, Val: 795, Test: 2048
args.model caffenet

VLCS Dataset

Hi,

I wanted to try your method on the VLCS dataset, as described in your paper, but I am having a hard time finding the dataset. Can you point me to where you get the dataset?

Thanks!

PACS Dataset

Hi ! Thanks for sharing the work! But the link of PACS Dataset failed. Could you update the download link of PACS! Thank u

Question on the loss function formulation

Thanks for making your code public. I had a question about the loss function mentioned in the paper versus what has been implemented in the code:

In the paper you have eq.
Screen Shot 2020-03-06 at 4 05 41 PM

However, in the implementation I find the following:

total_loss = loss_class + loss_domain + loss_entropy * beta

I am trying to understand how to correlate the two. I would appreciate it if you could provide more details on how the implementation matches the equation in the paper.

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.