pumpikano / tf-dann

Domain-Adversarial Neural Network in Tensorflow
MIT License
628 stars 224 forks source link

Does ordering matter? #1

Closed zumpchke closed 7 years ago

zumpchke commented 7 years ago

Does the relative ordering of training examples matter between source and target examples? I am trying to port this to another DL framework (which has its own inbuilt MNIST dataset).

pumpikano commented 7 years ago

In general, the batches should be sampled randomly from both source and target examples. Also, each batch should contain approximately 50% target examples and 50% source examples so there is not domain class (source vs. target) bias for the domain classifier. The implementation for MNIST in this repo samples examples from source and target domains randomly and constructs batches such that the first half of examples in each batch are all source examples and the second half are all target examples. This assumed batch structure is used to route only the source examples, which have class labels, to the class prediction network. I hope this helps!

zumpchke commented 7 years ago

Thanks! I just had to remind myself that it is unsupervised, that is, the labels of the target examples aren't required.