Machine Learning (Aerospace Applications)
Level 5 — Mastery (Cross-domain: Mathematics + Physics + Coding) Time limit: 2 hours 30 minutes Total marks: 60
Instructions: Attempt all three questions. Show full derivations; state assumptions. Pseudocode/NumPy-style code is accepted where requested. Marks are indicated per part.
Question 1 — Regularized Regression, Bias–Variance & Cross-Validation (20 marks)
An aerospace team fits a linear model (with , ) to estimate aerodynamic drag from sensor features.
(a) Starting from the ridge objective derive the closed-form (normal-equation) solution . Prove that for any the solution is unique even when is singular. (6)
(b) Consider the scalar case shape of all-ones and a single parameter , so . With data mean , show that the ridge estimate is , and interpret the shrinkage as increases. (4)
(c) Decompose the expected squared prediction error at a point into (irreducible) noise, bias, and variance. Explain physically why increasing moves a drag-estimation model along the bias–variance trade-off, and sketch the qualitative curves of bias, variance, and total error vs. . (6)
(d) You have flight-test samples and use -fold cross-validation to select . State how many models are trained, the size of each train/validation split, and one reason why L1 (lasso) rather than L2 might be preferred if only a few of sensors are truly informative. (4)
Question 2 — Backpropagation Through a Small Network (22 marks)
Consider a single hidden-layer network for binary fault detection: with scalar output, binary cross-entropy loss .
(a) Prove that . Show every step (do not skip the sigmoid derivative). (5)
(b) Using the chain rule, derive expressions for , , and in terms of the forward-pass quantities. Recall . (7)
(c) Numerically evaluate one backprop step for the following -input, -hidden-unit network. Given Compute (i) , , , ; (ii) ; (iii) the gradient . Give values to 4 decimal places. (6)
(d) Explain why ReLU is often preferred over in deep networks, referencing the gradient behaviour of in part (b), and state one drawback of ReLU. (4)
Question 3 — Reinforcement Learning for Learned Guidance (18 marks)
A guidance controller for a lunar-descent thruster is modelled as an MDP .
(a) Write the Bellman optimality equation for the action-value function and derive the tabular Q-learning update rule from it, stating the role of the learning rate and why it is an off-policy method. (6)
(b) For the REINFORCE policy-gradient method with policy , prove that using the log-derivative ("score function") trick. Explain why subtracting a baseline leaves the estimator unbiased. (7)
(c) A two-state descent task has . From state , the greedy action gives immediate reward and transitions to terminal state with . After one Q-learning update with from initial , compute the new . Then state the converged value if this reward/transition repeats deterministically. (5)
End of paper.
Answer keyMark scheme & solutions
Question 1
(a) [6] Gradient: (2). Rearranging: (1), hence (1) Uniqueness: is symmetric PSD with eigenvalues . Adding shifts eigenvalues to for , so is positive-definite, hence invertible; is strictly convex ⇒ unique minimiser (2).
(b) [4] , (2). Then (1) As , (OLS mean); as , — shrinkage toward zero, reducing variance at the cost of bias (1).
(c) [6] (3) where irreducible noise, Bias , Var . Increasing constrains parameters → less sensitivity to noise in flight data → variance ↓ but model less flexible → bias ↑ (2). Sketch: bias increasing curve, variance decreasing curve, total error U-shaped with minimum at optimal (1).
(d) [4] 5-fold ⇒ 5 models trained per value (1). Each fold: train on samples, validate on (2). L1 induces sparsity (drives irrelevant weights to exactly zero) performing feature selection when only a few sensors matter (1).
Question 2
(a) [5] (1). (2). Chain: (2).
(b) [7] Let (scalar). (2). Backprop to hidden: (3). (1); (1).
(c) [6] (i) (1). (1). ; (2). (ii) (1). (iii) (1).
(d) [4] saturates to for large ⇒ vanishing gradients in deep stacks slowing learning (2). ReLU has gradient for , avoiding saturation and giving sparse activations (1). Drawback: "dying ReLU" — units stuck at with zero gradient (or non-differentiable at 0) (1).
Question 3
(a) [6] (2). Sample-based stochastic approximation gives update: (2) weights new TD-target vs. current estimate (controls learning speed/stability) (1). Off-policy: the update uses (greedy target) regardless of the behaviour policy that generated the action (1).
(b) [7] . (log-trick) (3). , so (2). Replacing with return-to-go gives the stated form (1). Baseline unbiased: (1).
(c) [5] Target (1). Update: (2). Converged (deterministic, terminal next): fixed point (2).
[
{"claim":"Ridge scalar all-ones estimate n*ybar/(n+lambda)", "code":"n,lam=5,3; ys=[1,2,3,4,5]; ybar=sum(ys)/n; theta=n*ybar/(n+lam); result = abs(theta - (n*ybar/(n+lam)))<1e-12 and abs(theta-2.8125)<1e-9"},
{"claim":"Q2c forward/backward numeric values", "code":"import sympy as sp; z1=sp.Rational(1,2)*1 + sp.Rational(-1,2)*2; h=sp.tanh(z1); z2=1*h; phat=1/(1+sp.exp(-z2)); d2=phat-1; gW2=d2*h; result = abs(float(z1)+0.5)<1e-9 and abs(float(h)+0.46211715)<1e-6 and abs(float(phat)-0.38648)<1e-4 and abs(float(gW2)-0.28352)<1e-4"},
{"claim":"Q-learning single update yields 2.5 and converges to 5", "code":"alpha,gamma,r=0.5,0.9,5; Q=0; Q=Q+alpha*(r+gamma*0-Q); conv=r+gamma*0; result = abs(Q-2.5)<1e-12 and abs(conv-5)<1e-12"},
{"claim":"Sigmoid derivative identity used in Q2a", "code":"import sympy as sp; z=sp.symbols('z'); s=1/(1+sp.exp(-z)); result = sp.simplify(sp.diff(s,z) - s*(1-s))==0"}
]