speed up sparse coding