Notes on back propagation and a fast algorithm solving for the coefficients in sparse coding