So basically having two optimizers, one for the parameters of f and one for the parameters of g? I guess I would have to be careful about the order that I do backward and step, right? Because I’d want the gradients to be computed wrt. the parameters before any of them are updated. So I’d probably want to do backward for both objectives first, then step for the two optimizers. Does that sound right?
Thanks