I am learning calculus and I need help in writing a code for determining the minimum of a function with two real variables using the Gradient Descent Method.
The function is the following
g(x, y) = (1 – x + x2) * e(y2) + (1 – y + y2) * e**(x**2)
or written in Python using SymPy
g = (1 – x + x2) * sp.exp(y2) + (1 – y + y2) * sp.exp(x2).
I have identified the gradient of the function:
[2x(y2 – y + 1)*exp(x2) + (2x – 1)exp(y**2)
2y(x2 – x + 1)*exp(y2) + (2*y – 1)*exp(x**2)]
But I need help to continue. Thank you in advance.
Orhan94 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.