added andrew ng's code for space invariant sparse coding