Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Path: blob/master/C1 - Neural Networks and Deep Learning/Week 2/Week 2 Quiz - Neural Network Basics.md
Views: 4803
Week 2 Quiz - Neural Network Basics
What does a neuron compute?
A neuron computes an activation function followed by a linear function (z = Wx + b)
A neuron computes a linear function (z = Wx + b) followed by an activation function
A neuron computes a function g that scales the input x linearly (Wx + b)
A neuron computes the mean of all features before applying the output to an activation function
Note: we generally say that the output of a neuron is a = g(Wx + b) where g is the activation function (sigmoid, tanh, ReLU, ...).
Which of these is the "Logistic Loss"?
Check here.
Note: this is the logistic loss you've seen in lecture!
Suppose img is a (32,32,3) array, representing a 32x32 image with 3 color channels red, green and blue. How do you reshape this into a column vector?
x = img.reshape((32 * 32 * 3, 1))
Consider the two following random arrays "a" and "b":
What will be the shape of "c"?
b (column vector) is copied 3 times so that it can be summed to each column of a. Therefore,
c.shape = (2, 3)
.Consider the two following random arrays "a" and "b":
What will be the shape of "c"?
"*" operator indicates element-wise multiplication. Element-wise multiplication requires same dimension between two matrices. It's going to be an error.
Suppose you have n_x input features per example. Recall that X=[x^(1), x^(2)...x^(m)]. What is the dimension of X?
(n_x, m)
Recall that
np.dot(a,b)
performs a matrix multiplication on a and b, whereasa*b
performs an element-wise multiplication.Consider the two following random arrays "a" and "b":
What is the shape of c?
c.shape = (12288, 45)
, this is a simple matrix multiplication example.Consider the following code snippet:
How do you vectorize this?
c = a + b.T
Consider the following code:
What will be c?
This will invoke broadcasting, so b is copied three times to become (3,3), and ∗ is an element-wise product so
c.shape = (3, 3)
.Consider the following computation graph.
Answer:
(a - 1) * (b + c)