UFLDL tutorial exercise 1, written in C++ using libLBFGS, Eigen3 and OpenCV.