blue-blue272 / fewshot-can Goto Github PK
View Code? Open in Web Editor NEWCode of Cross Attention Network for Few-shot Classification (NeurIPS 2019).
Code of Cross Attention Network for Few-shot Classification (NeurIPS 2019).
in the residual attention mechanism,the initial feature maps P and Q are elementwisely weighted by 1 + A^p and 1 + A^q.
I guess that the linef1 = f1.unsqueeze(2) * a1.unsqueeze(3)
in cam.py is the elementwisely weighted operation.
However I can't find the operation of (1+) in your code.
I am deeply inspired by the excellent programming of this project. Thanks for your kindly sharing and look forward to your early reply.
Dear author, can ask you about which parts of your code cam.py is about meta learner to achieve?
Thank you for your time reading my issues. Best wishes!
您好
您的代码很简洁,方法的效果也很好,效果也是sota。但是我想问问该如何运行您的程序,需要配置什么环境,因为您好像没有说明该如何跑程序,谢谢。
I have downloaded Imagenet dataset (~140GB) then ran tiered imagenet tools on it to build the tiered imagent dataset, but it's not loading properly in your code. The error I am getting is the following:
Traceback (most recent call last):
File "train.py", line 188, in
main()
File "train.py", line 53, in main
dm = DataManager(args, use_gpu)
File "/home/sargsyan/fewshot-CAN/torchFewShot/data_manager.py", line 81, in init
load=args.load,
File "./torchFewShot/dataset_loader/init.py", line 21, in init_loader
return __loader_factory[name](*args, **kwargs)
File "./torchFewShot/dataset_loader/test_loader.py", line 74, in init
Tnovel, Exemplar = self._sample_episode()
File "./torchFewShot/dataset_loader/test_loader.py", line 88, in _sample_episode
Knovel = random.sample(self.labelIds, self.nKnovel)
File "/home/sargsyan/anaconda3/envs/pytorch/lib/python3.6/random.py", line 320, in sample
raise ValueError("Sample larger than population or is negative")
ValueError: Sample larger than population or is negative`
Could you please point me how you built the dataset you used, or provide access to the dataset?
Thank you.
Dear auther
there is some question in my mind: in the train stage, the num_classes is 64 which is the number of the miniImageNet_train.pickle, however, when i use the test.py to evaluate my model ,the num_classes is still 64 in the model , I'm a little confused about the few shot model's test principle.
Thank you for your time reading my issues. Best wishes!
您好,请问数据集实在哪里下载呀,就是需要自己把miniImageNet分开在跑实验么?miniImageNet_load.py是干什么的?我下载了您引用的一篇文章的数据集,里面是 .pickle文件有什么用呢?谢谢
你们的pickle文件是如何划分的啊,可否上传你们的pickle文件啊
您好:
您的代码很简洁,方法的效果也是sota。
但是我想请教一下,您在meta-train之前是否在base class上做过预训练呢?我直接运行您提供的train.py(所有参数均未改动),得到的结果只有百分之二十多?不知道是哪里出了问题,希望能得到您的回复,谢谢!
不好意思 再打扰一下,请问
1.数据库的话tieredImageNet和miniImageNet都是从mengye和matchingnet的官网上下载吗?
2.关于下载后的处理,我看到您dataset里面有miniImageNet.py和miniImageNet_load.py,但是他们的路径不一样,然后args_xent.py里面dataset参数为miniImageNet_load,是不是意味着就是读取miniimaget的数据时只用了miniImageNet_load.py?
3.不得不说您的算法真的很简洁很明了,是我们学习的榜样
4.请问一下transductive部分的代码是没有公布吗?
谢谢您的耐心
您好,请问可以分享一下划分好的TieredImagenet数据集吗?
老哥,十分感谢你能把代码开源。
不过好像缺少了data_manager、losses、optimizers、utils等子文件夹,以及谷歌云盘上的模型下载后无法解压,提示损坏。
能不能麻烦你开源完整的代码,以及检查下模型压缩包?感谢!
Hello! While reading the paper associated with the code, I noticed that in the paper (page 5 formula 5 & 6), the L1 is the "nearest neighbor classification loss" while L2 is the "global classification loss", and total loss L = lambda L1 + L2. Whereas in the code line 123-125, it seems to me the losses are a bit mixed up.
123 loss1 = criterion(ytest, pids.view(-1))
124 loss2 = criterion(cls_scores, labels_test.view(-1))
125 loss = loss1 + 0.5 * loss2
I'm wondering why the nearest neighbor classification loss is calculated with ytest and pids, which looks like the global loss.
Thank you for the help!
您好,我参照您放出的模型,以及论文里的各个细节自己写了训练代码,但是不能达到论文里强调的精度,请问是否介意放出训练源码,以便我更好的修改细节部分。
Hi, @blue-blue272!
I think this is an interesting and inspiring work, but in your released code, I don't find the code for "Transductive Inference" as shown in your paper. Maybe I don't find it. Can you point it out for me?
In your released code(default settings in args_xent.py), I also find that you use the test dataset to early stop, I don't think it's appropriate.
Looking forward to your reply!
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.