Unsupervised learning of an efficient short-term memory network