Giter Site home page Giter Site logo

pmorerio / minimal-entropy-correlation-alignment Goto Github PK

View Code? Open in Web Editor NEW
62.0 4.0 17.0 672 KB

Code for the paper "Minimal-Entropy Correlation Alignment for Unsupervised Deep Domain Adaptation", ICLR 2018

License: MIT License

Shell 4.43% Python 95.57%
domain-adaptation geodesic entropy

minimal-entropy-correlation-alignment's Introduction

Minimal-Entropy Correlation Alignment for Unsupervised Deep Domain Adaptation

In this work, we face the problem of unsupervised domain adaptation by leveraging our finding that entropy minimization is induced by the optimal alignment of second order statistics between source and target domains. Aiming at achieving an optimal alignment in practical cases, we adopt a more principled strategy which, differently from current Euclidean approaches, deploys correlation alignment along geodesics. Our pipeline can be implemented by adding to the standard classification loss (on the labeled source domain), a source-to-target regularizer that is weighted in an unsupervised fashion.

geo

Reference

If you use this code as part of any published research, please acknowledge the following paper:

"Minimal-Entropy Correlation Alignment for Unsupervised Deep Domain Adaptation"
Pietro Morerio, Jacopo Cavazza and Vittorio Murino
International Conference on Learning Representations (ICLR), 2018
PDF

  @article{
  morerio2018minimalentropy,
  title={Minimal-Entropy Correlation Alignment for Unsupervised Deep Domain Adaptation},
  author={Morerio, Pietro and Cavazza, Jacopo and Murino, Vittorio},
  journal={International Conference on Learning Representations},
  year={2018},
  url={https://openreview.net/forum?id=rJWechg0Z},
  }

Code

Each sub-folder (...in progress...) is named after the adaptation problem analyzed and equipped with its own README. The provided code runs with Python 2.7 (for python 3 just checkout the python3 branch). For the installation of tensorflow-gpu please refer to the website. The code is tested for tensorflow-gpu==1.4.0.

The following command should install the main dependencies on most Linux (Ubuntu) machines

sudo apt-get install python-dev python-pip && sudo pip install -r requirements.txt

Image samples

Left to rigth: SVHN, SYN, NYUD RGB, NYUD DEPTH (HHA), MNIST. images

License

This repository is released under the MIT LICENSE.

minimal-entropy-correlation-alignment's People

Contributors

pmorerio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

minimal-entropy-correlation-alignment's Issues

Accuracy is lower than the paper.

Hi ! I have re-run your code and got 90% accuracy for both log-d-coral and d-coral. Is there any missing in the code ? I just use following command:
for log-d-coral:
python main.py --mode='train' --method='log-d-coral' --alpha=1. --device='/gpu:0'
python main.py --mode='test' --method='log-d-coral' --alpha=1. --device='/gpu:0'

for d-coral:
python main.py --mode='train' --method='d-coral' --alpha=1. --device='/gpu:0'
python main.py --mode='test' --method='d-coral' --alpha=1. --device='/gpu:0'

SVHN โ†’ MNIST Architecture

In your paper you mentioned that "The architecture is the very same employed in [Ganin & Lempitsky (2015)] with the only difference that the last fully connected layer (fc2) has only 64 units instead of 2048. Performances are the same, but covariance computation is less onerous. fc2 is in fact the layer where domain adaptation i performed." But in your code I found that (may be I am wrong), fc2 has 128 units. Can you please explain here a little bit more to understand me please?
hidden_size = 128
self.hidden_repr_size = hidden_size

net = slim.fully_connected(net, self.hidden_repr_size, activation_fn=tf.tanh,scope='fc4')

using log_coral_loss with large activation

Hello, @pmorerio

Thank you for your nice work!

I got a question about calculating log_coral_loss.

Let say, activation after conv_layer is the size of [20, 256, 200, 176] (N, H, W, C respectively), it is too big to flatten and calculate the covariance matrix.

In this case, what can be a good solution?
(1x1 convolution and 2d_maxpool would work properly...?)
Do you have a similar experience?

Any advice and comments are welcome!

Thank you in advance.

eigen value of cov matrix

Hello, @pmorerio

I got another question about the eigenvalue of cov_matrix.

As far as I understood from your paper, cov_representation is positive definite, therefore
taking a logarithm on the eigenvalues makes sense.

However, when I decompose my covariance matrices I got some negative eigenvalues which result in nan logarithm values.

  1. Is this expected behavior?

  2. If so, coral_loss can perform as well as log_coral_loss?

I am afraid that I miss some part of your paper.
Any comments are welcome!!

Best,
Yoo

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.