Coder Social home page Coder Social logo

chef's Introduction

CHEF

Cross-domain few-shot learning by representation fusion

paper, blog

Download and prepare data

miniImagenet

Download the miniImagenet data from here. We use the data split proposed by Ravi & Larochelle. Create the folders images_train, images_val, images_test and place the respective files in them, as well as a folder images_trainval that must contain all images from images_train and images_val.

tieredImagenet

Download the tiereImagenet data from here. Extract it and create a folder trainval containing all images from the folders train and val.

Set up horizontal data splits

Run python3 make_miniImagenet_hsplit.py and python3 make_tieredImagenet_hsplit.py to set up the horizontal data splits for pretraining.

Cross-domain data

Follow the instructions in this repo to acquire and set up the cross-domain data sets.

Pre-training

Run python3 pretrain.py config/pretrain_{res10,res12,conv64}_{tier,mini}.json.

Testing

To test the pre-trained ResNet-10 on the four cross-domain data sets run python3 xdom_res10.py config/xdom_res10.json --dataset {isic,cropdisease,eurosat,chest}. To test the Imagenet-pre-trained ResNet-18 from PyTorch on the four cross-domain data sets run python3 xdom_res18.py config/xdom_res18.json --dataset {isic,cropdisease,eurosat,chest}. Without the --dataset option, the model will be run on the miniImagenet test set by default.

To test the pre-trained ResNet-12 and Conv-4 on the miniImagenet and tieredImagenet test sets run python3 test.py config/{res12,conv64}_{mini,tier}_{1,5}shot.json.

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.