Coder Social home page Coder Social logo

abdulfatir / prototypical-networks-tensorflow Goto Github PK

View Code? Open in Web Editor NEW
132.0 4.0 44.0 196 KB

Tensorflow implementation of NIPS 2017 Paper "Prototypical Networks for Few-shot Learning"

Jupyter Notebook 91.23% Shell 5.46% Python 3.31%
few-shot one-shot-learning tensorflow nips-2017 omniglot deep-learning ipython-notebook miniimagenet

prototypical-networks-tensorflow's Introduction

Prototypical Networks for Few-shot Learning

Tensorflow implementation of NIPS 2017 Paper Prototypical Networks for Few-shot Learning[1].

This code has been ported from the official implementation in PyTorch (jakesnell/prototypical-networks) and may be buggy.

Usage

Omniglot Dataset

  • Download the Omniglot dataset by executing download_omniglot.sh
  • Use the IPython Notebook ProtoNet-Omniglot.ipynb

mini ImageNet v2

Downloading Images

  • Create an account on image-net.org with your institutional ID.
  • Replace <username> and <accesskey> in download_miniimagenet.sh with the username and accesskey you receive upon registration.
  • Run download_miniimagenet.sh which will download 84 ImageNet classes from ILSVRC2011. (64 train + 20 test)

Testing on miniImageNet

  • Run create_miniimagenet.py which will generate mini-imagenet-train.npy and mini-imagenet-test.npy which are numpy arrays of shapes 64 x 350 x 84 x 84 x 3 and 20 x 350 x 84 x 84 x 3 respectively.
  • Use the IPython Notebook ProtoNet-MiniImageNet-v2.ipynb.

NOTE: This miniImageNet dataset is not identical to the one used by Ravi et. al.[2] They have used images from ILSVRC2012 which can be downloaded from here. Ravi et. al. have used 100 classes (64 training + 16 validation + 20 test) with 600 examples from each class. The script provided in this dataset downloads images from image-net.org which currently (Feb, 2018) contains images from ILSVRC2011. Therefore, some of the classes suggested by Ravi et. al. have less than 600 examples. For this reason, the number of examples of each class has been reduced to 350. The scripts provided download images corresponding to 84 classes (64 train + 20 test), the ones suggested by Ravi et. al., and then randomly samples 350 examples for each class.

References

[1] Jake Snell, Kevin Swersky, and Richard S. Zemel. Prototypical networks for few-shot learning.
[2] Sachin Ravi and Hugo Larochelle. Optimization as a model for few-shot learning.

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.