An algorithmic view of $\ell_2$ regularization and some path-following algorithms