# ▸Optimization algorithms :

 Improving Deep Neural Networks Week-2 (MCQ)

1. Which notation would you use to denote the 3rd layer’s activations when the input is the 7th example from the 8th minibatch?

1. Which of these statements about mini-batch gradient descent do you agree with?

• Training one epoch (one pass through the training set) using mini-batch gradient descent is faster than training one epoch using batch gradient descent.

• You should implement mini-batch gradient descent without an explicit for-loop over different mini-batches, so that the algorithm processes all mini-batches at the same time (vectorization).

• One iteration of mini-batch gradient descent (computing on a single mini-batch) is faster than one iteration of batch gradient descent.

1. Why is the best mini-batch size usually not 1 and not m, but instead something in between?

• If the mini-batch size is 1, you end up having to process the entire training set before making any progress.

• If the mini-batch size is m, you end up with stochastic gradient descent, which is usually slower than mini-batch gradient descent.

• If the mini-batch size is m, you end up with batch gradient descent, which has to process the whole training set before making progress.

• If the mini-batch size is 1, you lose the benefits of vectorization across examples in the mini-batch.

Suppose your learning algorithm’s cost J, plotted as a function of the number of iterations, looks like this:
Which of the following do you agree with?

• If you’re using mini-batch gradient descent, this looks acceptable. But if you’re using batch gradient descent, something is wrong.

• Whether you’re using batch gradient descent or mini-batch gradient descent, something is wrong.

• Whether you’re using batch gradient descent or mini-batch gradient descent, this looks acceptable.

• If you’re using mini-batch gradient descent, something is wrong. But if you’re using batch gradient descent, this looks acceptable.

1. Suppose the temperature in Casablanca over the first three days of January are the same:

Jan 1st: $\inline&space;\large&space;\theta_1&space;=&space;10^{\circ}&space;C$

Jan 2nd: $\inline&space;\large&space;\theta_2&space;=&space;10^{\circ}&space;C$

(We used Fahrenheit in lecture, so will use Celsius here in honor of the metric world.)
Say you use an exponentially weighted average with to track the temperature: $\inline&space;\large&space;v_0=0,\&space;v_t=\beta&space;v_{t-1}&space;+&space;(1-\beta)\theta_t$. If $\inline&space;\large&space;v_2$ is the value computed after day 2 without bias correction, and is the value you compute with bias correction. What are these values?

(You might be able to do this without a calculator, but you don’t actually need one. Remember what is bias correction doing.)

1. You use an exponentially weighted average on the London temperature dataset. You use the following to track the temperature: $\inline&space;\large&space;v_t&space;=&space;\beta&space;v_{t-1}&space;+&space;(1-\beta)&space;\theta_t$. The red line below was computed using $\inline&space;\large&space;\beta&space;=&space;0.9$. What would happen to your red curve as you vary β? (Check the two that apply)

• Decreasing β will shift the red line slightly to the right.

• Increasing β will shift the red line slightly to the right.
True, remember that the red line corresponds to β=0.9. In lecture we had a green line $$\beta = 0.98) that is slightly shifted to the right. • Decreasing β will create more oscillation within the red line. True, remember that the red line corresponds to β=0.9. In lecture we had a yellow line$$\beta = 0.98 that had a lot of oscillations.

• Increasing β will create more oscillations within the red line.

1. Consider this figure:

These plots were generated with gradient descent; with gradient descent with momentum (β = 0.5) and gradient descent with momentum (β = 0.9). Which curve corresponds to which algorithm?

• (1) is gradient descent with momentum (small β), (2) is gradient descent with momentum (small β), (3) is gradient descent

• (1) is gradient descent. (2) is gradient descent with momentum (large β) . (3) is gradient descent with momentum (small β)

• (1) is gradient descent with momentum (small β). (2) is gradient descent. (3) is gradient descent with momentum (large β)

• (1) is gradient descent. (2) is gradient descent with momentum (small β). (3) is gradient descent with momentum (large β)

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

1. Suppose batch gradient descent in a deep network is taking excessively long to find a value of the parameters that achieves a small value for the cost function $\inline&space;\large&space;J&space;(W^{[1]},b^{[1]},&space;.&space;.&space;.&space;,W^{[L]},b^{[L]})$. Which of the following techniques could help find parameter values that attain a small value for J? (Check all that apply)

• Try initializing all the weights to zero

• Try better random initialization for the weights

• Try tuning the learning rate α

&
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