Hi all,
I’m trying to implement the paper => Unsupervised Domain Adaptation by Backpropagation 4 by Gannin et. al.
The architecture is as follows -

image1180×545 78.9 KB

How  do we implement something like this in PyTorch. More specifically:

An architecture which has 2 different outputs that are trying to classify different things.
Run back-propagation taking into account the individual losses from both “branches”.
In this paper, the authors multiply the backprop values by -1 in the gradient reverse layer. How do we do something like that in PyTorch?