()
| 235 | |
| 236 | |
| 237 | def main(): |
| 238 | train, test, word2idx = get_ptb_data() |
| 239 | |
| 240 | train = train[:100] |
| 241 | test = test[:100] |
| 242 | |
| 243 | V = len(word2idx) |
| 244 | D = 80 |
| 245 | K = 5 |
| 246 | |
| 247 | model = RNTN(V, D, K, tf.nn.relu) |
| 248 | model.fit(train) |
| 249 | print("train accuracy:", model.score(None)) |
| 250 | print("test accuracy:", model.score(test)) |
| 251 | |
| 252 | |
| 253 | if __name__ == '__main__': |
no test coverage detected