forked from DimplesL/Deeplearning.ai
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathC2W2_Quiz_Optimization_algorithms.txt
42 lines (31 loc) · 3.02 KB
/
C2W2_Quiz_Optimization_algorithms.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
Quiz Week 2
Optimization algorithms
1. Which notation would you use to denote the 3rd layer’s activations when the input is the 7th example from the 8th minibatch?
a[3]{8}(7)
2. Which of these statements about mini-batch gradient descent do you agree with?
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).
3. Why is the best mini-batch size usually not 1 and not m, but instead something in-between?
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.
4. 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.
5. Suppose the temperature in Casablanca over the first three days of January are the same:
Jan 1st: θ1=10oC
Jan 2nd: θ210oC
(We used Fahrenheit in lecture, so will use Celsius here in honor of the metric world.)
Say you use an exponentially weighted average with β=0.5 to track the temperature: v0=0, vt=βvt−1+(1−β)θt. If v2 is the value computed after day 2 without bias correction, and vcorrected2 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.)
v2=7.5, vcorrected2=10
6. Which of these is NOT a good learning rate decay scheme? Here, t is the epoch number.
α = e^t * α0
7. You use an exponentially weighted average on the London temperature dataset. You use the following to track the temperature: vt=βvt−1+(1−β)θt. The red line below was computed using β=0.9. What would happen to your red curve as you vary β? (Check the two that apply)
Increasing β will shift the red line slightly to the right.
Decreasing β will create more oscillation within the red line.
8. 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. (2) is gradient descent with momentum (small β). (3) is gradient descent with momentum (large β)
9. 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 (W[1],b[1],...,W[L],b[L]). Which of the following techniques could help find parameter values that attain a small value for? (Check all that apply)
Try using Adam
Try better random initialization for the weights
Try mini-batch gradient descent
Try tuning the learning rate α
10. Which of the following statements about Adam is False?
Adam should be used with batch gradient computations, not with mini-batches.