Module 10 · after
The same 6 questions you saw before the module. No running the code: predict, then compare with your first score.
m, v = 0.0, 0.0 for t, g in [(1, 4.0), (2, 0.0)]: m = 0.85 * m + 0.15 * g v = 0.99 * v + 0.01 * g ** 2 m_hat = m / (1 - 0.85 ** t) v_hat = v / (1 - 0.99 ** t) step = 0.1 * m_hat / (v_hat ** 0.5 + 1e-8) print(round(step, 3))
lr, num_steps = 0.01, 1000 fast = [step for step in range(num_steps) if lr * (1 - step / num_steps) > 0.005] print(len(fast))
losses = [3.3, 2.1, 3.6, 2.4, 2.2, 2.6, 2.0] # step 1 is losses[0] k = 3 below = [i + 1 for i in range(k - 1, len(losses)) if sum(losses[i - k + 1:i + 1]) / k < 2.5] print(below[0])
Your answers are saved with a random id, not your name, so we can see which lessons work. Privacy