Deep Learning: Recurrent Neural Networks in Python: LSTM, GRU, and more RNN machine learning architectures in Python and Theano (Machine Learning in Python) by LazyProgrammer

Deep Learning: Recurrent Neural Networks in Python: LSTM, GRU, and more RNN machine learning architectures in Python and Theano (Machine Learning in Python) by LazyProgrammer

Author:LazyProgrammer
Language: eng
Format: epub
Published: 2016-08-07T22:00:00+00:00


def train_poetry():

# students: tanh didn't work but you should try it

sentences, word2idx = get_robert_frost()

rnn = SimpleRNN(30, 30, len(word2idx))

rnn.fit(sentences, learning_rate=10e-5, show_fig=True, activation=T.nnet.relu, epochs=2000)

rnn.save('RNN_D30_M30_epochs2000_relu.npz')

def generate_poetry():

sentences, word2idx = get_robert_frost()

rnn = SimpleRNN.load('RNN_D30_M30_epochs2000_relu.npz', T.nnet.relu)

rnn.generate(word2idx)

if __name__ == '__main__':

train_poetry()

generate_poetry()



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.