Implemented collaborative filtering gradient and regularized cost function