Input-driven unsupervised learning in recurrent neural networks