Skip to content

Commit

Permalink
Fix the issue #9.
Browse files Browse the repository at this point in the history
  • Loading branch information
trekhleb committed Jan 10, 2019
1 parent d16d88e commit 04ecea6
Show file tree
Hide file tree
Showing 4 changed files with 1,161 additions and 1,161 deletions.
2 changes: 1 addition & 1 deletion homemade/linear_regression/linear_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def gradient_step(self, alpha, lambda_param):
# Vectorized version of gradient descent.
theta = theta * reg_param - alpha * (1 / num_examples) * (delta.T @ self.data).T
# We should NOT regularize the parameter theta_zero.
theta[1] = theta[1] - alpha * (1 / num_examples) * (self.data[:, 0].T @ delta).T
theta[0] = theta[0] - alpha * (1 / num_examples) * (self.data[:, 0].T @ delta).T

self.theta = theta

Expand Down
Loading

0 comments on commit 04ecea6

Please sign in to comment.