Softmax regression exercise from http://ufldl.stanford.edu/