MCPcopy Create free account
hub / github.com/lazyprogrammer/machine_learning_examples / train_poetry

Function train_poetry

rnn_class/rrnn_language.py:196–201  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

194
195
196def train_poetry():
197 # students: tanh didn't work but you should try it
198 sentences, word2idx = get_robert_frost()
199 rnn = SimpleRNN(50, 50, len(word2idx))
200 rnn.fit(sentences, learning_rate=1e-4, show_fig=True, activation=T.nnet.relu, epochs=2000)
201 rnn.save('RRNN_D50_M50_epochs2000_relu.npz')
202
203def generate_poetry():
204 sentences, word2idx = get_robert_frost()

Callers 1

rrnn_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