MCPcopy Index your code
hub / github.com/lazyprogrammer/machine_learning_examples / train_poetry

Function train_poetry

rnn_class/srn_language.py:211–215  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

209
210
211def train_poetry():
212 sentences, word2idx = get_robert_frost()
213 rnn = SimpleRNN(30, 30, len(word2idx))
214 rnn.fit(sentences, learning_rate=1e-4, show_fig=True, activation=T.nnet.relu, epochs=2000)
215 rnn.save('RNN_D30_M30_epochs2000_relu.npz')
216
217def generate_poetry():
218 sentences, word2idx = get_robert_frost()

Callers 1

srn_language.pyFile · 0.70

Calls 4

fitMethod · 0.95
saveMethod · 0.95
get_robert_frostFunction · 0.90
SimpleRNNClass · 0.70

Tested by

no test coverage detected