CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
y33-j3T

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

GitHub Repository: y33-j3T/Coursera-Deep-Learning
Path: blob/master/Improving Deep Neural Networks Hyperparameter tuning, Regularization and Optimization/week5/Gradient Checking/testCases.py
Views: 13377
1
import numpy as np
2
3
def gradient_check_n_test_case():
4
np.random.seed(1)
5
x = np.random.randn(4,3)
6
y = np.array([1, 1, 0])
7
W1 = np.random.randn(5,4)
8
b1 = np.random.randn(5,1)
9
W2 = np.random.randn(3,5)
10
b2 = np.random.randn(3,1)
11
W3 = np.random.randn(1,3)
12
b3 = np.random.randn(1,1)
13
parameters = {"W1": W1,
14
"b1": b1,
15
"W2": W2,
16
"b2": b2,
17
"W3": W3,
18
"b3": b3}
19
20
21
return x, y, parameters
22