@apaszke  Please consider the Eq. 8, 9, 10, 11. in https://arxiv.org/pdf/1711.06861.pdf 26
Eq. 8 - Minimize CrossEntropy Loss
Eq 9 - Maximize Entropy of Label(minimizing the negative of Entropy)
which is a different Loss not present in the package but can be created as: -∑ p.log(p) and i’ll have to manually construct it.
Eq 10 - Minimize CrossEntropy Loss
The issue is with Eq 9, where the computation is like: op = Classifier(Encoder(x)) and the Loss only wants to optimize the Encoder model for the op loss.
Like i mentioned in the example above, this would be easy to do if the loss was backpropogated individually, I could just do Encoder_Optimizer.step()
But, the paper model is end-to-end trained which means that they are just backpropogating Eq. 11; where Eq 11 = Eq 8 + Eq 9 + Eq 10
The problem here is that since some other loss ie. Eq 8 wants to optimize the Classifier model so the Classifier will end up being updated by gradients from both Eq 8 and Eq 9.
I hope i’m understanding it correctly, and, Is there some way to do this?