Modifying a strategy to allow for the model to have more than one output. #437
-
I am trying to implement a strategy called Domain Adversarial Training where my model needs to output both a class prediction as well as a domain prediction. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Answer from @Mattdl: "self.logits is returned the output of the self.model(), hence calling the forward() if your model. By overriding the forward, you can just return a tuple in forward(), then you can access this anywhere in your strategy with self.logits[index-in-tuple]." |
Beta Was this translation helpful? Give feedback.
Answer from @Mattdl: "self.logits is returned the output of the self.model(), hence calling the forward() if your model. By overriding the forward, you can just return a tuple in forward(), then you can access this anywhere in your strategy with self.logits[index-in-tuple]."