Skip to content

Instantly share code, notes, and snippets.

View pranavsuri's full-sized avatar
🌴
On Vacation

Pranav Suri pranavsuri

🌴
On Vacation
View GitHub Profile
@pranavsuri
pranavsuri / gradient_descent.py
Created February 14, 2018 11:26
How to find the minima using Gradient Descent? Read blog post at http://bit.ly/2z7eWmQ.
from sympy import *
x, y = symbols('x y')
# Objective Function
f = x*y + 2*(62.5/x) + 2*(62.5/y)
# Differentiating - computing the gradient.
fpx = f.diff(x)
fpy = f.diff(y)