## ▸ Neural Network Basics :

Recommended Machine Learning Courses:

- Coursera: Machine Learning
- Coursera: Deep Learning Specialization
- Coursera: Machine Learning with Python
- Coursera: Advanced Machine Learning Specialization
- Udemy: Machine Learning
- LinkedIn: Machine Learning
- Eduonix: Machine Learning
- edX: Machine Learning
- Fast.ai: Introduction to Machine Learning for Coders

- What does a neuron compute?
- A neuron computes an activation function followed by a linear function (z = Wx + b)
- A neuron computes the mean of all features before applying the output to an activation function
- A neuron computes a function g that scales the input x linearly (Wx + b)
**A neuron computes a linear function (z = Wx + b) followed by an activation function**

**Correct**

Correct, 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"?

**Correct**

Correct, 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((1,32*32,*3))
**x = img.reshape((32*32*3,1))**

**Correct**- x = img.reshape((3,32*32))
- x = img.reshape((32*32,3))
- Consider the two following random arrays "a" and "b":

What will be the shape of "c"? - The computation cannot happen because the sizes don't match. It's going to be "Error"!
- c.shape = (2, 1)
- c.shape = (3, 2)
**c.shape = (2, 3)**

**Correct**

Yes! This is broadcasting. b (column vector) is copied 3 times so that it can be summed to each column of a.- Consider the two following random arrays "a" and "b":

What will be the shape of "c"? - c.shape = (4, 3)
- c.shape = (4,2)
- c.shape = (3, 3)
**The computation cannot happen because the sizes don't match. It's going to be "Error"!**

**Correct**

Indeed! In numpy the "*" operator indicates element-wise multiplication. It is different from "np.dot()". If you would try "c = np.dot(a,b)" you would get c.shape = (4, 2).- Suppose you have input features per example. Recall that . What is the dimension of X?

**Correct**- Recall that "np.dot(a,b)" performs a matrix multiplication on a and b, whereas "a*b" performs an element-wise multiplication.

Consider the two following random arrays "a" and "b":

What is the shape of c? - c.shape = (12288, 150)
**c.shape = (12288, 45)**

**Correct**

Correct, remember that a np.dot(a, b) has shape (number of rows of a, number of columns of b). The sizes match because :

"number of columns of a = 150 = number of rows of b"- The computation cannot happen because the sizes don't match. It's going to be "Error"!
- c.shape = (150,150)
- Consider the following code snippet:

How do you vectorize this? - c = a.T + b
- c = a.T + b.T
- c = a + b
**c = a + b.T**

**Correct**- Consider the following code:

What will be c? (If you’re not sure, feel free to run this in python to find out). **This will invoke broadcasting, so b is copied three times to become (3,3), and ∗ is an element-wise product so c.shape will be (3, 3)**

**Correct**- This will invoke broadcasting, so b is copied three times to become (3, 3), and ∗ invokes a matrix multiplication operation of two 3x3 matrices so c.shape will be (3, 3)
- This will multiply a 3x3 matrix a with a 3x1 vector, thus resulting in a 3x1 vector. That is, c.shape = (3,1).
- It will lead to an error since you cannot use “*” to operate on these two matrices. You need to instead use np.dot(a,b)
- Consider the following computation graph. What is the output J?
- J = (c - 1)*(b + a)
**J = (a - 1) * (b + c)**

**Correct**

Yes. J = u + v - w = a*b + a*c - (b + c) = a * (b + c) - (b + c) = (a - 1) * (b + c).- J = a*b + b*c + a*c
- J = (b - 1) * (c + a)

###
**Check-out our free tutorials on IOT (Internet of Things):**

--------------------------------------------------------------------------------

**Click here**to see solutions for all

**Machine Learning**Coursera Assignments.

&

**Click here**to see more codes for

**Raspberry Pi 3**and similar Family.

&

**Click here**to see more codes for

**NodeMCU ESP8266**and similar Family.

&

**Click here**to see more codes for

**Arduino Mega (ATMega 2560)**and similar Family.

Feel free to ask doubts in the comment section. I will try my best to answer it.

If you find this helpful by any mean like, comment and share the post.

This is the simplest way to encourage me to keep doing such work.

Thanks & Regards,

**- APDaga DumpBox**
On an intermediate layer with dimensions 24X24X32, if a 2D average pooling layer of size 2X2 and stride 1 is applied. What would be the resulting dimension of the next layer?

ReplyDelete