Imported from https://github.com/martin-gorner/tensorflow-rnn-shakespeare