Code Monkey home page Code Monkey logo

mldg's People

Contributors

domaingeneralization avatar haha-dl 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

mldg's Issues

MLDG on ResNet

I am wondering what is the best practice to apply your method to bigger architectures, e.g. ResNet-50. Should I replace all conv layers in the resnet model?

Thanks in advance

Question about domain's partition?

After I read the paper, one question remains for me, you wrote that the domain S is splited into meta-train domains and meta-test domains.
For example, the domain can be the style of images, image A has two styles: cartoon and realistic image.
Then in the Alg. 1, the meta train loss is calculated on the A's cartoon style, and meta val loss is calculated on the A's realistic style?
Or the two loss are computed on completed different images' styles: A's cartoon style for meta train loss, and image B's realistic style for meta val loss?
yours sincerely.
Thank you!

Results unreliable

Thanks for your implementation.

I have run run_mldg.sh two times and check the result in file run_1 and run_2.

In each of the logs_mldg_(0-3), I check the heldout_test_log.txt and flag_log.txt.

I got following results:
run_1:
logs_mldg_0: unseen_index=0 heldout_test_log=0.70849
logs_mldg_1: unseen_index=1 heldout_test_log=0.47440
logs_mldg_2: unseen_index=2 heldout_test_log=0.95449
logs_mldg_3: unseen_index=3 heldout_test_log=0.39246
run_2:
logs_mldg_0: unseen_index=0 heldout_test_log=0.72363
logs_mldg_1: unseen_index=1 heldout_test_log=0.48677
logs_mldg_2: unseen_index=2 heldout_test_log=0.95748
logs_mldg_3: unseen_index=3 heldout_test_log=0.40697
The average is just around 0.63, and each result is much different from the result reported in paper. So it is hard to believe this is the accuracy regarding each unseen domain(A C P S).

I don't change any parameters in run_mldg.sh and main_mldg.py
Did I do something wrong or I misunderstood something?

Thank you very much.

Could you upload the new version

@Yash-Vardhan-Sharma
Thanks for your interests in our paper.

This was originally for demo purpose and for people to easily run the algorithm, so the backbone is just a shallow MLP trained with the pre-extracted ResNet-18 feature. That is why the result is different from the reported.

Ok, I will update the repo to replace the backbone as the one used in the paper to remove confusion.

Originally posted by @dali-dl in #2 (comment)

Could you please upload the version with new backbone, thanks.

About the first-order approximation

Hi, thank you for this fascinating work and providing a demo of MLDG.

Two quick questions:

  1. Did you use the first-order approximation in the MLP version of MLDG. The codes in ops.py look like an operation of the first-order approximation.

`

    if not stop_gradient:
        grad_weight = autograd.grad(meta_loss, weight, create_graph=True)[0]

        if bias is not None:
            grad_bias = autograd.grad(meta_loss, bias, create_graph=True)[0]
            bias_adapt = bias - grad_bias * meta_step_size
        else:
            bias_adapt = bias

    else:
        grad_weight = Variable(autograd.grad(meta_loss, weight, create_graph=True)[0].data, requires_grad=False)

        if bias is not None:
            grad_bias = Variable(autograd.grad(meta_loss, bias, create_graph=True)[0].data, requires_grad=False)
            bias_adapt = bias - grad_bias * meta_step_size
        else:
            bias_adapt = bias

    return F.linear(inputs,
                    weight - grad_weight * meta_step_size,
                    bias_adapt)
else:
    return F.linear(inputs, weight, bias)`
  1. I am also wondering the meaning of the parameter "--stop_gradient". What would happen when we set it ture?

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.