Generating invariant representations with cortex-inspired models of unsupervised learning