Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dragen1860/LearningToCompare-Pytorch
Pytorch Implementation for CVPR2018 Paper: Learning to Compare: Relation Network for Few-Shot Learning
https://github.com/dragen1860/LearningToCompare-Pytorch
Last synced: 13 days ago
JSON representation
Pytorch Implementation for CVPR2018 Paper: Learning to Compare: Relation Network for Few-Shot Learning
- Host: GitHub
- URL: https://github.com/dragen1860/LearningToCompare-Pytorch
- Owner: dragen1860
- Created: 2018-01-22T12:16:26.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-02-15T06:50:45.000Z (over 6 years ago)
- Last Synced: 2024-10-22T23:30:41.732Z (17 days ago)
- Language: Python
- Homepage:
- Size: 30.3 KB
- Stars: 250
- Watchers: 10
- Forks: 48
- Open Issues: 2
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
- awesome-few-shot-meta-learning - code (PyTorch)
README
# LearningToCompare
Pytorch Implementation for Paper: Learning to Compare: Relation Network for Few-Shot Learning# Howto
download mini-imagenet and make it looks like:
```shell
mini-imagenet/
├── images
├── n0210891500001298.jpg
├── n0287152500001298.jpg
...
├── test.csv
├── val.csv
└── train.csvLearningToCompare-Pytorch/
├── compare.py
├── MiniImagenet.py
├── Readme.md
├── repnet.py
├── train.py
└── utils.py
``````python
python train.py
```# NOTICE
current code support multi-gpus on single machine training, to disable it and train on single machine,
just set device_ids=[0] and downsize batch size according to your gpu memory capacity.
make sure `ckpt` directory exists, otherwise `mkdir ckpt`.# mini-Imagenet
| Model | Fine Tune | 5-way Acc. | | 20-way Acc | |
|-------------------------------------|-----------|------------|--------|------------|--------|
| | | 1-shot | 5-shot | 1-shot | 5-shot |
| Matching Nets | N | 43.56% | 55.31% | 17.31% | 22.69% |
| Meta-LSTM | | 43.44% | 60.60% | 16.70% | 26.06% |
| MAML | Y | 48.7% | 63.11% | 16.49% | 19.29% |
| Meta-SGD | | 50.49% | 64.03% | 17.56% | 28.92% |
| TCML | | 55.71% | 68.88% | - | - |
| Learning to Compare | N | 57.02% | 71.07% | - | - |
| **Ours, similarity ensemble** | N | 55.2% | 68.8% | | |
| **Ours, feature ensemble** | N | 55.2% | 70.1% | | |