Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replication Parameters and How to use MixStyle and EFDM #50

Open
VirtueZhao opened this issue Aug 20, 2022 · 1 comment
Open

Replication Parameters and How to use MixStyle and EFDM #50

VirtueZhao opened this issue Aug 20, 2022 · 1 comment

Comments

@VirtueZhao
Copy link

VirtueZhao commented Aug 20, 2022

Dear Kaiyang

Really appreciate the open-source domain generalization framework. It is really amazing.
I'm currently working on replicating the results and extending my work on the current framework. Do you mind sharing the parameters for each baseline to replicate the results mentioned in your AAAI-2020 (DDAIG)? When I tried to replicate the baseline results of CrossGrad and DomainMix, the results were much worse than the paper. I guess it may be caused by the parameter tunning because I'm currently using the default settings of the framework (I didn't change any single line of the framework). In the config files, there are only configs about DDAIG, DAELDG, and Vanilla. (All these three are very good).

On the other hand, could you please post an instruction about how to run MixStyle and EFDM by the framework?

Thank you very much!

@KaiyangZhou
Copy link
Owner

KaiyangZhou commented Aug 21, 2022

To reproduce DDAIG, please refer to the log files in #6 (comment).

CrossGrad's hyper-parameters should be these https://github.com/KaiyangZhou/Dassl.pytorch/blob/master/dassl/config/defaults.py#L260 (but forgot if I had tuned them).

I wasn't the one submitting the DomainMix code. Perhaps you can check with the author who submitted the PR.

The example of running MixStyle or EFDMix on, e.g., pacs, is

python tools/train.py \
--root ${DATA_ROOT} \
--seed 1 \
--trainer Vanilla \  # aka ERM
--dataset-config-file configs/datasets/dg/pacs.yaml \  # the standard params for the pacs dataset
--config-file configs/trainers/dg/vanilla/pacs.yaml \  # the custom params for vanilla
--source-domains art_painting cartoon photo \
--target-domains sketch \
--output-dir ${OUTPUT_DIR} \
MODEL.BACKBONE.NAME resnet18_ms_l12  # this will override the model name in configs/datasets/dg/pacs.yaml

To use Dassl as a library, I'd suggest you take a look at the structure of https://github.com/KaiyangZhou/mixstyle-release/tree/master/imcls and https://github.com/KaiyangZhou/CoOp. Don't need to dig deep into the code. Just follow the structure. So basically you need to 1) have train.py and add your trainer's config variables, 2) create folders for trainers, datasets (if you have new datasets), or models (if you use custom models not provided in this repo).

For instance, for a new project you typically need to have

train.py
trainers/
    my_trainer.py 
datasets/
    dataset_a.py
    dataset_b.py
configs/
    datasets/
        dataset_a.yaml
        dataset_b.yaml
    trainers/
        my_trainer.yaml

Hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants