GithubHelp home page GithubHelp logo

ameroyer / flextuning Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 2.63 MB

Flextuning, WACV 2020

Home Page: https://arxiv.org/abs/2008.11995

Python 4.06% Jupyter Notebook 95.94%
adapters classification domain-adaptation finetuning

flextuning's Introduction

ReadMe and instructions: Work in progress

Introduction

Implementation of Flextuning described in A Flexible Selection Scheme for Minimum-Effort Transfer Learning, WACV 2020

@article{flextuning,
		        author = {Royer, Am\'{e}lie and Lampert, Christoph H.},
		        title = {A Flexible Selection Scheme for Minimum-Effort Transfer Learning},
		        journal = {Winter Conference on Applications of Computer Vision (WACV)},
		        year = {2020}
		      }

Quick usage

# Requires Tensorflow (tested with 1.12 / 1.14)

# Download Mnist source/target domains from 
wget ist.ac.at/~aroyer/Models/Data.zip
# Alternatively you can compute them (see input_pipeline.ipynb)


# Run only the first time
mkdir results
mkdir txt_logs
unzip Data.zip

# Main
python3 main.py mnist --all

Will run one repeat of all tuning experiments on MNIST -> target domains. Results of experiments are printed in terminal + saved in a dictionary (in results/). Additional logs are output in txt_logs/ (just text files) and log/ (Tensorboard summaries). See main.py.

Codebase

Datasets:

  • input_pipeline.ipynb : Visualize the datasets + Convert them to TFRecords format for convenience. Also pretrain a "base model" on the source domain that will be used as initialization for tuning.
  • setting.py : Defines the different source and target domains for convenience + if it is run at main, it will create susampled ratios of each datasets.
  • include/dataset_utils.py: Functions to parse the datasets + image transformation for the target domains. Use low-level functions defined in include/tfrecords_utils.py and include/preprocess_utils.py.

Classifiers:

  • net_utils.py : Architectures (Note: The second half of the file is only used for experiments described in section 5.4 in the paper. You can also ignore the file include/graph_utils.py, it is also only really useful for section 5.4 for optional preprcessing when feeding outputs from the preprocessing module to the classifier)
  • include/graph_manager.py : It defines two things: First a "Setting" object, which essentially a wrapper to define source/target datasets. and a "Classifier" object which defines the training loop. it comes with "train" and "test" functions: This part is probably the most "Tensorflow specific" part of the code. For convenience, subclasses of the Classifier base class are then defined in include/classifiers.py

Run experiments:

  • main.py: Basically gathers the whole experiment setups
  • include/run_exp.py: Given a classfier, and a list of source/domain datasets, it takes care of training/evaluating all different finetuned/flextuned models and save logs.

Fast and Faster-flex variants

Which unit to "flextune" ? The two faster selectio criteria are explored in selection_criterion.ipynb

flextuning's People

Contributors

ameroyer avatar

Watchers

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