Skip to content

Commit 65efc87

Browse files
authored
Merge pull request #70 from farhan-najeeb/patch-1
Update C2_W4_Assignment.ipynb
2 parents 1328136 + dd28bc3 commit 65efc87

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

2 - Natural Language Processing with Probabilistic Models/Labs/Week 4/C2_W4_Assignment.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -698,9 +698,9 @@
698698
" # Compute the gradient of W2\n",
699699
" grad_W2 = (1/batch_size)*np.dot(yhat-y,h.T)\n",
700700
" # Compute the gradient of b1\n",
701-
" grad_b1 = np.sum((1/batch_size)*np.dot(l1,x.T),axis=1,keepdims=True)\n",
701+
" grad_b1 = np.sum((1/batch_size)*l1,axis=1,keepdims=True)\n #1/m * relu(w2.T(yhat-y)) . 1mT\n"",
702702
" # Compute the gradient of b2\n",
703-
" grad_b2 = np.sum((1/batch_size)*np.dot(yhat-y,h.T),axis=1,keepdims=True)\n",
703+
" grad_b2 = np.sum((1/batch_size)*(yhat-y),axis=1,keepdims=True)\n",
704704
" ### END CODE HERE ###\n",
705705
" \n",
706706
" return grad_W1, grad_W2, grad_b1, grad_b2"

0 commit comments

Comments
 (0)