Skip to content

Instantly share code, notes, and snippets.

@abdalimran
Created November 13, 2017 16:30
Show Gist options
  • Save abdalimran/651e537c49b7aff2a46bea03fa3b7773 to your computer and use it in GitHub Desktop.
Save abdalimran/651e537c49b7aff2a46bea03fa3b7773 to your computer and use it in GitHub Desktop.
gamma = 0.001
x = 6
iterations = 5000
for i in range(0,iterations):
x_gradient = 2*x
x1 = x - gamma * x_gradient
x = x1
print("iterations =",iterations,"\nx = ",x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment