Skip to content

Instantly share code, notes, and snippets.

@starhopp3r
Created September 26, 2017 02:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save starhopp3r/e1d30ec491d5dfad7daf5948022a5bb1 to your computer and use it in GitHub Desktop.
Save starhopp3r/e1d30ec491d5dfad7daf5948022a5bb1 to your computer and use it in GitHub Desktop.
def gradient_descent_runner(points, starting_c, starting_m, learning_rate, num_iterations):
c = starting_c
m = starting_m
# Iterate
for i in range(num_iterations):
c, m = step_gradient(c, m, array(points), learning_rate)
return [c, m]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment