fewshot

所属分类:其他
开发工具:Python
文件大小:8605KB
下载次数:1
上传日期:2019-03-31 09:07:33
上 传 者对对对对的
说明:  当标注数据量比较少时,怎么学习出好的特征?我们需要泛化这些罕见的类别,而不需要额外的训练,因为训练会因为数据少、代价高、周期长而无法获得收益。下面介绍近几年几种解决小样本问题的方法,我们将这些方法称为fewshot learning(如果只有一个标注样本,称oneshot learning)
(When the amount of tagged data is relatively small, how to learn good features? We need to generalize these rare categories without additional training, because training will not benefit because of the low data, high cost and long cycle. Here are a few methods to solve the small sample problem in recent years. We call these methods fewshot learning (if there is only one labeled sample, it is called oneshot learning).)

文件列表:
LICENSE (1067, 2018-08-05)
datas (0, 2018-08-05)
datas\miniImagenet (0, 2018-08-05)
datas\miniImagenet\proc_images.py (1532, 2018-08-05)
datas\miniImagenet\test.csv (384015, 2018-08-05)
datas\miniImagenet\train.csv (1228815, 2018-08-05)
datas\miniImagenet\val.csv (307215, 2018-08-05)
datas\omniglot_28x28.zip (11728579, 2018-08-05)
miniimagenet (0, 2018-08-05)
miniimagenet\miniimagenet_test_few_shot.py (8590, 2018-08-05)
miniimagenet\miniimagenet_test_one_shot.py (8061, 2018-08-05)
miniimagenet\miniimagenet_train_few_shot.py (11587, 2018-08-05)
miniimagenet\miniimagenet_train_one_shot.py (11256, 2018-08-05)
miniimagenet\models (0, 2018-08-05)
miniimagenet\models\miniimagenet_feature_encoder_5way_1shot.pkl (456999, 2018-08-05)
miniimagenet\models\miniimagenet_feature_encoder_5way_5shot.pkl (456999, 2018-08-05)
miniimagenet\models\miniimagenet_relation_network_5way_1shot.pkl (465209, 2018-08-05)
miniimagenet\models\miniimagenet_relation_network_5way_5shot.pkl (465209, 2018-08-05)
miniimagenet\task_generator.py (5276, 2018-08-05)
miniimagenet\task_generator_test.py (6299, 2018-08-05)
omniglot (0, 2018-08-05)
omniglot\models (0, 2018-08-05)
omniglot\models\omniglot_feature_encoder_20way_1shot.pkl (452391, 2018-08-05)
omniglot\models\omniglot_feature_encoder_20way_5shot.pkl (452391, 2018-08-05)
omniglot\models\omniglot_feature_encoder_5way_1shot.pkl (452391, 2018-08-05)
omniglot\models\omniglot_feature_encoder_5way_5shot.pkl (452391, 2018-08-05)
omniglot\models\omniglot_relation_network_20way_1shot.pkl (448823, 2018-08-05)
omniglot\models\omniglot_relation_network_20way_5shot.pkl (448823, 2018-08-05)
omniglot\models\omniglot_relation_network_5way_1shot.pkl (448823, 2018-08-05)
omniglot\models\omniglot_relation_network_5way_5shot.pkl (448823, 2018-08-05)
omniglot\omniglot_test_few_shot.py (8601, 2018-08-05)
omniglot\omniglot_test_one_shot.py (8402, 2018-08-05)
omniglot\omniglot_train_few_shot.py (11263, 2018-08-05)
omniglot\omniglot_train_one_shot.py (10898, 2018-08-05)
omniglot\task_generator.py (5900, 2018-08-05)

# LearningToCompare_FSL PyTorch code for CVPR 2018 paper: [Learning to Compare: Relation Network for Few-Shot Learning](https://arxiv.org/abs/1711.06025) (Few-Shot Learning part) For Zero-Shot Learning part, please visit [here](https://github.com/lzrobots/LearningToCompare_ZSL). # Requirements Python 2.7 Pytorch 0.3 # Data For Omniglot experiments, I directly attach omniglot 28x28 resized images in the git, which is created based on [omniglot](https://github.com/brendenlake/omniglot) and [maml](https://github.com/cbfinn/maml). For mini-Imagenet experiments, please download [mini-Imagenet](https://drive.google.com/open?id=0B3Irx3uQNoBMQ1FlNXJsZUdYWEE) and put it in ./datas/mini-Imagenet and run proc_image.py to preprocess generate train/val/test datasets. (This process method is based on [maml](https://github.com/cbfinn/maml)). # Train omniglot 5way 1 shot: ``` python omniglot_train_one_shot.py -w 5 -s 1 -b 19 ``` omniglot 5way 5 shot: ``` python omniglot_train_few_shot.py -w 5 -s 5 -b 15 ``` omniglot 20way 1 shot: ``` python omniglot_train_one_shot.py -w 20 -s 1 -b 10 ``` omniglot 20way 5 shot: ``` python omniglot_train_few_shot.py -w 20 -s 5 -b 5 ``` mini-Imagenet 5 way 1 shot: ``` python miniimagenet_train_one_shot.py -w 5 -s 1 -b 15 ``` mini-Imagenet 5 way 5 shot: ``` python miniimagenet_train_few_shot.py -w 5 -s 5 -b 10 ``` you can change -b parameter based on your GPU memory. Currently It will load my trained model, if you want to train from scratch, you can delete models by yourself. ## Test omniglot 5way 1 shot: ``` python omniglot_test_one_shot.py -w 5 -s 1 ``` Other experiments' testings are similar. ## Citing If you use this code in your research, please use the following BibTeX entry. ``` @inproceedings{sung2018learning, title={Learning to Compare: Relation Network for Few-Shot Learning}, author={Sung, Flood and Yang, Yongxin and Zhang, Li and Xiang, Tao and Torr, Philip HS and Hospedales, Timothy M}, booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition}, year={2018} } ``` ## Reference [MAML](https://github.com/cbfinn/maml) [MAML-pytorch](https://github.com/katerakelly/pytorch-maml)

近期下载者

相关文件


收藏者