I want to optimize the parameters vector, gamma, and v using pytorch or tensorflow optimization algorithms like Adam. The code below is my cost function and I want to minimize i