Understanding the comment in Tutorial 02 about differentiating through NLSS vs TheseusLayer #556
-
Thanks for the helpful tutorials! I am going through Tutorial 02 In this tutorial, we have
My confusion: when the comment says "the TheseusLayer objective" doesn't that also include Here, Second minor clarification: the part about "in this example" refers to the entire Tutorial 02, not just to the section 3.2 at the end, right? Thanks for any help / advice you may wish to provide. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @DanielTakeshi. This note refers to a somewhat subtle point that happens under the hood. It turns out that for this particular example, the derivative of the outer loss with respect to the learned parameter doesn't actually need derivative information of the NLLS optimization (e.g. , you can wrap the optimizer call with I think the wording of this note might be a bit confusing, since it seems to contradict the written code. |
Beta Was this translation helpful? Give feedback.
Hi @DanielTakeshi. This note refers to a somewhat subtle point that happens under the hood. It turns out that for this particular example, the derivative of the outer loss with respect to the learned parameter doesn't actually need derivative information of the NLLS optimization (e.g. , you can wrap the optimizer call with
torch.no_grad()
and you can still reduce the outer loss). You can see the associated discussion in #27. It's been a while since I looked at this example, but that's the main idea, IIRC.I think the wording of this note might be a bit confusing, since it seems to contradict the written code.