In Andrew Ng's Coursera course Machine Learning, he introduced a collaborative filtering algorithm, where the optimization objective is
$$ \min_{x^{(1)}, \dots, x^{(n_m)} \ \theta^{(1)}, \dots, \theta^{(n_\mu)}} \frac{1}{2} \sum_{(i, j): r(i ,j) = 1} ((\theta^{(j)})^T x^{(i)} - y^{(i, j)})^2 + \frac{\lambda}{2} \sum_{i = 1}^{n_m} \sum_{k = 1}^n (x^{(i)}k)^2 + \frac{\lambda}{2} \sum{j = 1}^{n_\mu} \sum_{k = 1}^n (\theta^{(j)}_k)^2 $$
and the vectorized expression is
where