Skip to content

Commit

Permalink
Update lab_utils_uni.py
Browse files Browse the repository at this point in the history
Fixes C1_W1_Lab05_Gradient_Descent_Soln.ipynb with error "OverflowError: Python int too large to convert to C long on the last graph"
  • Loading branch information
diegomoran3 committed Apr 29, 2023
1 parent 7b1556a commit a5e3f59
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ def plt_divergence(p_hist, J_hist, x_train,y_train):

# Print w vs cost to see minimum
fix_b = 100
w_array = np.arange(-70000, 70000, 1000)
w_array = np.arange(-70000, 70000, 1000, dtype="int64")
cost = np.zeros_like(w_array)

for i in range(len(w_array)):
Expand All @@ -316,6 +316,8 @@ def plt_divergence(p_hist, J_hist, x_train,y_train):
#===============

tmp_b,tmp_w = np.meshgrid(np.arange(-35000, 35000, 500),np.arange(-70000, 70000, 500))
tmp_b = tmp_b.astype('int64')
tmp_w = tmp_w.astype('int64')
z=np.zeros_like(tmp_b)
for i in range(tmp_w.shape[0]):
for j in range(tmp_w.shape[1]):
Expand Down

0 comments on commit a5e3f59

Please sign in to comment.