Skip to content

Commit

Permalink
Merge pull request greyhatguy007#19 from moligarch/main
Browse files Browse the repository at this point in the history
Optional Lab error fixed (Overflow Error)
  • Loading branch information
greyhatguy007 committed May 25, 2023
2 parents fe57d6f + 4536e39 commit 51f2056
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,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, dtype="int64")
cost = np.zeros_like(w_array)
cost = np.zeros_like(w_array,float)

for i in range(len(w_array)):
tmp_w = w_array[i]
Expand All @@ -318,7 +318,7 @@ 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)
z=np.zeros_like(tmp_b,float)
for i in range(tmp_w.shape[0]):
for j in range(tmp_w.shape[1]):
z[i][j] = compute_cost(x_train, y_train, tmp_w[i][j], tmp_b[i][j] )
Expand Down

0 comments on commit 51f2056

Please sign in to comment.