Created
October 24, 2018 15:46
-
-
Save muhammadgaffar/db65b80cff5f2d04f367e9e700b86348 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 initialize_velocity(parameters): | |
L = len(parameters) // 2 # number of layers in the neural networks | |
v = {} | |
# Initialize velocity | |
for l in range(L): | |
v["dW" + str(l+1)] = np.zeros((parameters["W" + str(l+1)].shape[0],parameters["W" + str(l+1)].shape[1])) | |
v["db" + str(l+1)] = np.zeros((parameters["b" + str(l+1)].shape[0],parameters["b" + str(l+1)].shape[1])) | |
return v |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment