yfzhang114 / adanpc Goto Github PK
View Code? Open in Web Editor NEWThis is an official PyTorch implementation of the ICML 2023 paper AdaNPC and SIGKDD paper DRM.
License: MIT License
This is an official PyTorch implementation of the ICML 2023 paper AdaNPC and SIGKDD paper DRM.
License: MIT License
python -m domainbed.scripts.download --data_dir=/my/datasets/path --dataset pacs;
return D:\Anaconda3\envs\final\python.exe: No module named domainbed.scripts.download;
all the requirements are satisfied
Hi,
Thank you for your outstanding contribution. I'd like to bring to your attention a potential concern in implementation. It's possible that it might inadvertently enable gradient in adaptation (see the link below), leading to increased GPU memory consumption. Would you mind to have a check on this?
https://github.com/yfzhang114/AdaNPC/blob/282e4130fa4e88878e00197561eba508ffb81448/domainbed/adapt_algorithms.py#L510C5-L510C5
To Reproduce results for DRM,
sh scripts/launch.sh pretrain resnet50 10 3 local DRM
sh scripts/launch.sh sup resnet50 10 3 local DRM
sh scripts/launch.sh unsup resnet50 10 3 local DRM
First of all,what specific results are these three reproducing?(Table?Figure? in the paper)
Secondly,i wonder are these commands complete?cuz I got some problems while running the second command(fail to use pertrained model)
Eventually,i'm kinda confused cuz this codebase is a mixture of AdaNPC and DRM while i'm only interested in DRM.If I only want to compare DRM as a test-time-adaptation algorithm with others, how should I do it? (If reproducing already includes this part, please ignore this question).
when i want to exeute the domainbed.scripts.train.py knn algorithm,i get errors as follows:
self.classifier = MomentumQueue(self.featurizer.n_outputs, self.hparams['queue_size'], self.hparams['temperature'], self.hparams['k'], num_classes)
KeyError: 'queue_size'
so how to fix it? thanks
line 149
in the class KNN(Algorithm)
is,
AdaNPC/domainbed/algorithms.py
Lines 147 to 149 in c280d6b
Eq.(4) in the paper is,
Thanks for your project.
I have a question about Where is the detailed
Although line 149
in the class KNN(Algorithm)
(see above) , replaces F.cross_entropy(a, b)
with F.nll_loss(torch.log(a), b)
, I think it still does not achieve Eq.(4) function.
Because F.nll_loss(torch.log(a), b)
and F.cross_entropy(a, b)
have the same results, referring to How is Pytorch’s Cross Entropy function related to softmax, log softmax, and NLL.
Besides, there seems to be no implementation of EM in this project.
When testing with test-time adaptation algorithm in unsupervised_adaptation.py
, what is the meaning or usage of storing accuracies and get the best accuracy for env{test}_out
? As I think env{test}_in
should be the split for testing, while env{test}_out
is for test-domain model selection (according to the original DomainBed).
AdaNPC/unsupervised_adaptation.py
Lines 408 to 415 in 007ec44
Btw I think ent
should be passed instead of acc
on line 414
It seems to take the groud truth features from all test data.
In your AdaNPC
, you take all the test data with ground truth labels (e.g., the name with out
datasets) as the prototypes for inference.
AdaNPC/unsupervised_adaptation.py
Lines 327 to 328 in c280d6b
Officially, the condition and 'out' not in name
should be added to avoid such leakage of test-data information.
AdaNPC/domainbed/scripts/unsupervised_adaptation.py
Lines 324 to 325 in c280d6b
python -m domainbed.scripts.train --data_dir /my/datasets/path --output_dir /my/pretrain/path --algorithm ERM --dataset PACS --hparams '{"backbone": "resnet50"}'
return File "F:\ART_1\AdaNPC-master\domainbed\scripts\train.py", line 228, in
for x,y in next(train_minibatches_iterator)]
StopIteration
domainbed. scripts.unsupervised_adapation
Line 420:
ent_on_test.append(acc)
should be
ent_on_test.append(ent)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.