()
| 194 | |
| 195 | |
| 196 | def 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 | |
| 203 | def generate_poetry(): |
| 204 | sentences, word2idx = get_robert_frost() |
no test coverage detected