PythonOT / POT

POT : Python Optimal Transport
https://PythonOT.github.io/
MIT License
2.42k stars 499 forks source link

Barycentric mapping and label propagation #70

Closed ycui123 closed 6 years ago

ycui123 commented 6 years ago

Could anyone tell me that how do you transfer the label after using barycentric mapping? Cause you don't have labels for target, you would like to transfer source labels to the mapping points?

Is this available in some part of the code ? Thank you so much.

rflamary commented 6 years ago

I suppose you are referring to this reference:

[5] N. Courty; R. Flamary; D. Tuia; A. Rakotomamonjy, Optimal Transport for Domain Adaptation, in IEEE Transactions on Pattern Analysis and Machine Intelligence , vol.PP, no.99, pp.1-1

One of the OTDA assumption is that the labels are conserved after mapping which means that you do not need to transfer them (just use the labels in the source). This is why in the code we provide only tools to perform the mapping.

ycui123 commented 6 years ago

Hi Remi,

Thanks for the reply. Yes,I was talking about [5]. Sorry, I asked the problem in a wrong way but my problem is how do we know which source point is mapping to which point? Could you refer me to an example or a piece of code? Thank you

kowshikthopalli commented 6 years ago

ok. Here is an example. https://github.com/rflamary/OTML_DS3_2018 . This is a tutorial organized by the developers. First you need to solve zeroth assignment and get the answer and use it to open the solutions. The answers to your question is in exercise 1. Go through the readme for more. Doing these exercises has helped me a great deal. Takes less than 25 minutes for first two exercises which is all you need

ycui123 commented 6 years ago

Hi @kowshikthopalli,

That example is indeed helpful. So I noticed that labels were preserved in the same order as before (source). I was afraid that the order would be different after you did the mapping. The example clears things up.

And I noticed that in the example, uniform distribution is applied. Would the above still apply when we don't use uniform distribution?

Thanks!

rflamary commented 6 years ago

Thank you @kowshikthopalli for your better answer.

Note that a simple 2d example of otda and illustration of which source and Target samples are related is given in

https://github.com/rflamary/POT/blob/master/notebooks/plot_otda_d2.ipynb

ycui123 commented 6 years ago

@rflamary Thanks for the illustration! It's very helpful.

ycui123 commented 5 years ago

Hi @rflamary ,

I've followed the tutorial above in https://github.com/rflamary/OTML_DS3_2018 exercise 1.

But I found that when you try to print the accuracy of mnist after OT, accuracy is lower than usps. And I found that the OT is sensitive to the machine learning algorithms as well, because when I tried to use CNN to do the classification, the result is not improved. Am I missing something here?

Thanks!