2 losses, 1 forward pass #12987
Unanswered
charleswilmot
asked this question in
Q&A
Replies: 1 comment
-
You can check the optimized IR. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone,
I can't find documentation for my use case, maybe because I'm not sure how to formulate my problem.
Say I have a networks composed of 10 layers, with weights
W_0, W_1, ..., W_9
.Now I want to optimize these weights with respect to 2 loss functions called
loss_outer
andloss_inner
, whereloss_inner
only applies to weightsW_4, W_5, W_6
loss_outer
applies to weightsW_0, ..., W_3
andW_7, ..., W_9
In the code above, will XLA take care of simplifying the computation graph such that the forward pass is computed only once?
Can you think of a better way to compute the gradients, without computing the forward pass twice ?
Many thanks to anyone who's willing to help me with that :-)
Beta Was this translation helpful? Give feedback.
All reactions