Git Product home page Git Product logo

Comments (9)

jihanyang avatar jihanyang commented on July 30, 2024

hello, thanks for your interesting to our work.
To reproduce the source only result of ResNet-50, 1. you need to remove our L_2-dropout in forward stage. 2. you need to remove the bottleneck layer in our classifier. This layer is widely used in previous methods (eg., CDAN, JAN etc.), while doesn't appear in original ResNet-50 architecture.
Please try these manners first to address your problem. If you have any other questions, feel free to cantact us. Hope my suggestion is useful for you.

Jihan

from afn.

HHHedo avatar HHHedo commented on July 30, 2024

Hi,
Does "the bottleneck layer in classifier" mean the bottleneck in residual blocks should be replaced by basicblocks?
In Pytorch, the implement is
resnet('resnet50', Basicblock, [3, 4, 6, 3], pretrained, progress, **kwargs)

from afn.

jihanyang avatar jihanyang commented on July 30, 2024

Hello, you can check the difference between the classifier of pytorch offical ResNet-50 and ours.

self.fc1 = nn.Sequential(
nn.Linear(2048, 1000),
nn.BatchNorm1d(1000, affine=True),
nn.ReLU(inplace=True),
nn.Dropout()
)
self.fc2 = nn.Sequential(
nn.Linear(1000, 1000),
nn.BatchNorm1d(1000, affine=True),
nn.ReLU(inplace=True),
nn.Dropout()
)

You can also check the bottleneck layer implementation of CDAN.
https://github.com/thuml/CDAN/blob/f7889063b76fca0b9a7147c88103d356531924bd/pytorch/network.py#L137

from afn.

HHHedo avatar HHHedo commented on July 30, 2024

Hi,
I just modified the classifier as you advised, which is
self.fc3 = nn.Linear(2048, class_num)
And the result for Office-31 A to W is:
Epoch 50: 0.740880503144654 Epoch 60: 0.7534591194968554 Epoch 70: 0.7509433962264151 Epoch 80: 0.7257861635220125 Epoch 90: 0.7584905660377359 Epoch 100: 0.7446540880503144
which is still better than reported.

from afn.

jihanyang avatar jihanyang commented on July 30, 2024

Hello, you shouldn't use target images for source only result.

from afn.

HHHedo avatar HHHedo commented on July 30, 2024

Hello, you shouldn't use target images for source only result.

Of course, I didn't use the target images.
where the main code is :
opt_g.zero_grad()
s_bottleneck = netG(s_imgs)
s_logit = netF(s_bottleneck)
s_cls_loss = get_cls_loss(s_logit, s_labels)
loss = s_cls_loss
loss.backward()
opt_g.step()
Maybe you can try this yourself, though this has nothing to do with AFN which can be reporduced.
Anyway, many thanks to your patient answers and help.

from afn.

jihanyang avatar jihanyang commented on July 30, 2024

Hello, due to my recent projects, I am sorry that I cannot schedule time to check the result. I will try to reproduce this experiment once I finish my projects at hand.

from afn.

Ruijia-Xu avatar Ruijia-Xu commented on July 30, 2024

Hello @HHHedo, thanks first for your interests in our work.

You are right by pointing out the fact that most of existing papers (including this work) share a same copy of the reported accuracies under the 'source-only' setting.

What might make you confused is the exact object this 'source-only' model point to. In these papers, it means a model that uses the source domain to fine-tune the Imagenet-pretrained model and then directly deploys in the target domain. It was conducted and reported by the very first paper (I forget which paper...) and cited by other papers.

However, as different DA methods develop, you might have to adjust the operators (e.g., bn, dropout...), configuration of the task-specific classifier, optimization strategy, ..., which differ significantly from the shape of the original 'source-only' model. As a result, the latter one cannot be directly obtained by just excluding some losses.

From my own view, it is also encouraged to report both results, one from the original paper and the other one by using your own practices.

Best.

from afn.

HHHedo avatar HHHedo commented on July 30, 2024

from afn.

Related Issues (15)

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.