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.

0 / 3 solved

  1. 01
    Linear 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
  2. 02
    Vectorized 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
  3. 03
    Power 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.

    From Singular Value Decomposition

    ImplementMedium25 min