Training recurrent neural networks