Fixes the "RuntimeError: Trying to backward through the graph a second time, but the saved intermediate results have already been freed. Specify retain_graph=True when calling backward the first time." by using .detach(). We should make sure that this is still what we want it to do but it runs now.
Changed the backdrop update to only run the minibatch through the dynamics model and not the whole buffer. This is what is supposed to happen and also speed up the forward pass.