(B=12, learning_rate=1., epochs=1000)
| 123 | |
| 124 | |
| 125 | def parity(B=12, learning_rate=1., epochs=1000): |
| 126 | X, Y = all_parity_pairs_with_sequence_labels(B) |
| 127 | |
| 128 | rnn = SimpleRNN(4) |
| 129 | rnn.fit(X, Y, |
| 130 | batch_sz=len(Y), |
| 131 | learning_rate=learning_rate, |
| 132 | epochs=epochs, |
| 133 | activation=tf.nn.sigmoid, |
| 134 | show_fig=False |
| 135 | ) |
| 136 | |
| 137 | |
| 138 | if __name__ == '__main__': |
no test coverage detected