• Stars
    star
    1,043
  • Rank 43,950 (Top 0.9 %)
  • Language
    Python
  • License
    MIT License
  • Created over 6 years ago
  • Updated almost 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

PyTorch code for CVPR 2018 paper: Learning to Compare: Relation Network for Few-Shot Learning (Few-Shot Learning part)

LearningToCompare_FSL

PyTorch code for CVPR 2018 paper: Learning to Compare: Relation Network for Few-Shot Learning (Few-Shot Learning part)

For Zero-Shot Learning part, please visit here.

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 and maml.

For mini-Imagenet experiments, please download mini-Imagenet 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).

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

MAML-pytorch

More Repositories

1

Deep-Learning-Papers-Reading-Roadmap

Deep Learning papers reading roadmap for anyone who are eager to learn this amazing tech!
Python
37,895
star
2

Meta-Learning-Papers

Meta Learning / Learning to Learn / One Shot Learning / Few Shot Learning
2,612
star
3

DRL-FlappyBird

Playing Flappy Bird Using Deep Reinforcement Learning (Based on Deep Q Learning DQN using Tensorflow)
Python
576
star
4

DDPG

Reimplementation of DDPG(Continuous Control with Deep Reinforcement Learning) based on OpenAI Gym + Tensorflow
Python
549
star
5

Deep-Reasoning-Papers

Recent Papers including Neural Symbolic Reasoning, Logical Reasoning, Visual Reasoning, planning and any other topics connecting deep learning and reasoning
295
star
6

LLM-with-RL-papers

A collection of LLM with RL papers
208
star
7

wechat_jump_end_to_end

Playing Wechat Jump Game with End-to-End Convolutional Neural Networks
Python
180
star
8

DQN-Atari-Tensorflow

Simplest Version of playing Atari with Deep Q Learning in Tensorflow
Python
160
star
9

Lifelong-Learning-Paper-List

Lifelong/Continual Learning Paper List
150
star
10

Tracking-on-iOS

Test Several Visual Object Tracking Algorithm including CMT,TLD,CT on iOS
C++
73
star
11

a2c_cartpole_pytorch

advantage actor-critic reinforcement learning for openai gym cartpole
Python
64
star
12

PlaneWar

Written in Swift Using latest Sprite kit a copy version of wechat game 微信打飞机!
Swift
62
star
13

meta-critic-networks

Pytorch code for Arxiv Paper: Learning to learn: Meta-Critic Networks for Sample-Efficient Learning
Python
56
star
14

wechat_jump_end_to_end_train

Playing Wechat Jump Game with End-to-End Convolutional Neural Networks (Train code)
Python
45
star
15

DDPG-tensorflow

DDPG on OpenAI Gym Pendulum
Python
19
star
16

CLDrone

Autonomous Quadrotor Simulation Research Platform based on ROS,Gazebo,Pixhawk,DRCsim..
C++
14
star
17

PhysicsFieldsWorld

Swift
14
star
18

researchGPT

a collection of cookbooks to use ChatGPT for academic research.
Python
8
star
19

iOS_WiFi_EV3_Library

Objective-C
8
star
20

Gym-Flappy-Bird

A OpenAI Gym Env for Flappy Bird
Python
6
star
21

songrotek.github.io

Personal Website
HTML
3
star
22

EV3Car

iPhone Control ev3 car by bluetooth
Objective-C
2
star
23

EV3PortViewer

Objective-C
1
star
24

EV3Tank

Objective-C
1
star
25

SystemSoundServices

Objective-C
1
star
26

Character-Animation-AI-Paper-List

1
star
27

tinyCNNOSX

run tiny CNN on OSX
C++
1
star