fcdl94 / Multi-Domain-Learning

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Multi-Domain-Learning

This code provide two type of neural nets able to classify different type of dataset. The accepted data-set are those included in the decathlon challenge.

There are mainly two model:

  1. 28 Wide Residual network that can be used both as Feature extractor or with fine tuning.
  2. A piggyback network that is similar to a 28 resnet but applies binary mask that are dataset-specific.
  3. A quantized network that is similar in spirit to Piggyback, but adds an affine transformation to the binary mask, increasing the network capacity.

Many parts of the code were made by Massimiliano Mancini that helped me a lot in rearraning the code.


This code require to have installed:

  • Python3
  • Pytorch (at least 0.4.0)
  • Numpy (I'm using 1.16.2, maybe it works also with older versions)
  • Visdom (I'm using 0.1.8.8)

And it's mandatory to have CUDA configured if you'd run it on NVIDIA GPUs


Commands to run the code:

python main.py [Arguments]

The most important arguments are:

  • net <The method to use, options: resnet (fine-tuning), piggyback, quantized>
  • pretrained <The path to pretrained model, if not added, it will start from scratch>
  • dataset <The dataset that you want to train, options: d_names = 'imagenet12','cifar100','daimlerpedcls','dtd','gtsrb','omniglot','svhn','ucf101','vgg-flowers'>

To see the other parameter run: 'python main.py -h' Remeber to modify the path to the dataset in training.py with the location of the dataset in your file system.


Check out the project RobotChallenge to see the implementation of the parallel and residual adapters of Rebuffi 1 2.

If you have any question or suggestion, please write to me an email

About


Languages

Language:Python 87.0%Language:Shell 13.0%