Code Monkey home page Code Monkey logo

tapnet's Introduction

TapNet: Neural Network Augmented with Task-Adaptive Projection for Few-Shot Learning

Code for the ICML 2019 paper TapNet: Neural Network Augmented with Task-Adaptive Projection for Few-Shot Learning

Dependencies

  • This code is tested on Ubuntu 16.04 with Python 3.6 and chainer 5.20

Data

miniImageNet

#Download and unzip "mini-imagenet.tar.gz" from Google Drive link in [few-shot-ssl-public]

#Place mini-imagenet-cache-train.pkl, mini-imagenet-cache-val.pkl , mini-imagenet-cache-test.pkl files in TapNet/miniImageNet_TapNet/data

cd /TapNet/miniImageNet_TapNet/data

Run python convert_data.py

tieredImageNet

#Download and unzip "tiered-imagenet.tar.gz" from Google Drive link in [few-shot-ssl-public]

#Place images and labels .pkl files in TapNet/tieredImageNet_TapNet/data

cd /TapNet/tieredImageNet_TapNet/data

Run python convert_data.py

Running the code

#For miniImageNet experiment

cd /TapNet/miniImageNet_TapNet/scripts
python train_TapNet_miniImageNet.py --gpu {GPU device number}
                                    --n_shot {n_shot}
                                    --nb_class_train {number of classes in training}
                                    --nb_class_test {number of classes in test}
                                    --n_query_train {number of queries per class in training}
                                    --n_query_test {number of queries per class in test}
                                    --wd_rate {Weight decay rate}
                                    
                                    
#For tieredImageNet experiment

cd /TapNet/tieredImageNet_TapNet/scripts
python train_TapNet_tieredImageNet.py --gpu {GPU device number}
                                    --n_shot {n_shot}
                                    --nb_class_train {number of classes in training}
                                    --nb_class_test {number of classes in test}
                                    --n_query_train {number of queries per class in training}
                                    --n_query_test {number of queries per class in test}
                                    --wd_rate {Weight decay rate}

tapnet's People

Contributors

istarjun avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.