Created
August 18, 2020 19:18
-
-
Save tarunlnmiit/75902865526a5b01914d5404353424d1 to your computer and use it in GitHub Desktop.
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
def calculateGradient(W, X, Y, f_x, learningRate): | |
gradient = (Y - f_x) * X | |
gradient = np.sum(gradient, axis=0) | |
# gradient = np.array([float("{0:.4f}".format(val)) for val in gradient]) | |
temp = np.array(learningRate * gradient).reshape(W.shape) | |
W = W + temp | |
return gradient, W.astype(float) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment