Advertisement
Guest User

Untitled

a guest
Nov 20th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. def gd(X,y):
  2. theta = np.zeros(2)
  3. lr = 0.01
  4. theta1 = theta
  5. theta = gd_update_epoch(X, y, theta, lr)
  6. while abs_diff(theta, theta1) > 0.01:
  7. theta_hold = theta
  8. theta = gd_update_epoch(X, y, theta, lr)
  9. theta1 = theta_hold
  10.  
  11. return theta
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement