sample_sparsecoding revised