Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def gd(X,y):
- theta = np.zeros(2)
- lr = 0.01
- theta1 = theta
- theta = gd_update_epoch(X, y, theta, lr)
- while abs_diff(theta, theta1) > 0.01:
- theta_hold = theta
- theta = gd_update_epoch(X, y, theta, lr)
- theta1 = theta_hold
- return theta
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement