Checkpoint: first-order derivatives
Quiz
- For f(x, y) = x^2 y + 3y^2, which vector is โf(1, 2)?
- (4, 13)
- (2, 6)
- (13, 4)
- (4, 7)
- What is the shape of the Jacobian of F: R^n to R^m, and what does row i contain?
- m x n, and row i is the transposed gradient of output f_i
- m x m, and row i is the gradient of output f_i
- m x n, and row i is the gradient of input x_i
- n x m, and row i is the gradient of input i
- For f = g โ h with h: R^n to R^m and g: R^m to R^k, which expression is the Jacobian J_f(x)?
- J_g(h(x)) J_h(x)
- J_h(h(x)) J_g(x)
- J_g(x) J_h(x)
- J_h(x) J_g(h(x))
- Which statements about the gradient โf(x) of a scalar function f: R^n to R are correct? Select all that apply.
- Its norm equals the slope of f along the gradient direction.
- It has the same shape as x, with one entry per input coordinate.
- It points in the direction of steepest increase of f at x.
- A zero gradient at a point proves the point is a local minimum.
- It is orthogonal to the level set of f through x.
- Which statements about the chain rule for composed functions are correct? Select all that apply.
- The shape test (k x m)(m x n) = k x n catches reversed products.
- The outer Jacobian J_g is evaluated at the input x.
- For a scalar-valued composition, โf(x) = J_h(x)^T โg(h(x)).
- An elementwise map t = ฯ(a) has a diagonal Jacobian diag(ฯ'(a_i)).
- The affine map a = Wx + b has Jacobian W, independent of x.
- The central-difference estimate of one gradient component is (f(x + h e_i) - f(x - h e_i)) / (2h), and its truncation error is of order ____.
- For F: R^n to R^m, the Jacobian J_F has shape ____ (write it as m x n with your numbers).
- For f = g โ h with g scalar-valued, the gradient is โf(x) = J_h(x)^T ____.
- Derive by hand the gradient of f(x, y) = (x - 2)^2 + 3(y + 1)^2 + xy, then verify each component with a central difference in Python at the point (1, -1). Describe your derivation, your numeric check, and the relative error you observed.
- Take h(x1, x2) = (x1 x2, x1 + x2^2) and g(y1, y2) = y1 y2, so f = g โ h. Build the Jacobian product by hand, then confirm the resulting gradient numerically. Explain each step of the chain and how you checked it.
Sign in to submit answers.