Code Monkey home page Code Monkey logo

closerlookfewshot's Introduction

A Closer Look at Few-shot Classification

Source code to ICLR'19, 'A Closer Look at Few-shot Classification' (still under construction)

This is a PyTorch implementation of our paper A Closer Look at Few-shot Classification accepted by ICLR 2019.

A detailed empirical study in few-shot classification with an integrated testbed

Enviroment

Setting preparation

First check and modify the dirs in ./configs.py

#CUB

#mini-ImageNet

#mini-ImageNet->CUB

  • Finish preparation for CUB and mini-ImageNet
  • Change directory to ./filelists/miniImagenet
  • run python ./write_cross_filelist.py (check paths in it first)

#self-defined setting

  • Require 3 data split json file: 'base.json', 'val.json', 'novel.json' for each dataset
  • The format should look like
    {"label_names": ["class0","class1",...], "image_names": ["filepath1","filepath2",...],"image_labels":[l1,l2,l3,...]}
    See test.json for reference
  • Put these file in the same folder and change data_dir['DATASETNAME'] in configs.py to the folder path

Train

Run python ./train.py --dataset [DATASETNAME] --model [BACKBONENAME] --method [METHODNAME] [--OPTIONARG]

For example, run python ./train.py --dataset miniImagenet --model Conv4 --method baseline --train_aug
Commands below follow this example, and please refer to io_utils.py for more options

Save features

Save feature before classifaction layer to increase test speed, not applicable to MAML, but required for other methods
Run python ./save_features.py --dataset miniImagenet --model Conv4 --method baseline --train_aug

Test

Run python ./test.py --dataset miniImagenet --model Conv4 --method baseline --train_aug

Reference

This testbed has modified and integrated the following codes:

Citation

Please cite the article:

"A Closer Look at Few-shot Classification" Wei-Yu Chen, Yen-Cheng Liu, Zsolt Kira, Yu-Chiang Frank Wang, Jia-Bin Huang, ICLR'19

closerlookfewshot's People

Contributors

wyharveychen avatar ycliu93 avatar

Watchers

James Cloos 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.