Practice track
Math foundations
Matrix operations, gradients and optimization written with numpy. 3 problems, about 65 minutes. Do them in order: each problem uses ideas from the problems before it.
- 01Linear regression by gradient descent
Mean squared error, its gradients for weights and bias, and a batch gradient descent loop that records the cost after each update.
From Linear Regression
ImplementEasy20 min - 02Vectorized pairwise distances
Euclidean distance and cosine similarity matrices from one matrix product, with a clip at 0 and a zero-vector rule.
From Norms and Distances
ImplementMedium20 min - 03Power iteration for the top eigenpair
The top eigenvalue and eigenvector of a symmetric matrix by power iteration, with a tolerance, an iteration limit and a sign rule.
ImplementMedium25 min