keras-team / keras

Deep Learning for humans
http://keras.io/
Apache License 2.0
61.56k stars 19.41k forks source link

How do I implement a many-to-many RNN for language modeling? #1469

Closed camcam3 closed 8 years ago

camcam3 commented 8 years ago

Most of the examples I read in Keras such as the char_rnn implement RNNs where the prediction is made at the end only. For language modeling, I would like to predict y after each step, such as the one described in this paper http://arxiv.org/pdf/1409.2329v5.pdf as implemented by TensorFlow https://www.tensorflow.org/versions/master/tutorials/recurrent/index.html. rnn

fchollet commented 8 years ago

You use return_sequences=True in your RNN layer(s). It's in the docs.