Created
April 17, 2020 13:47
-
-
Save nusco/ddf34e5721cded8ceb4d6c541869f75a to your computer and use it in GitHub Desktop.
From "Programming Machine Learning": gradient calculation with multiple input variables
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The gradient with multile input variables | |
def gradient(X, Y, w): | |
return 2 * np.matmul(X.T, (predict(X, w) - Y)) / X.shape[0] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment