Ok this one is a quick one. I am going to mainly use this page just to refer to it when going over Likelihood Ratio Trick and sampling being non-differentiable.
Suppose we want to take the derivative of with respect to . Let’ go to high school for a second.
Just rearrange the terms and we are done:
Just remamber the last equation. We will use it a lot.