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

Function main

nlp_class2/recursive_tensorflow.py:218–231  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

216
217
218def main():
219 train, test, word2idx = get_ptb_data()
220
221 train = train[:100]
222 test = test[:100]
223
224 V = len(word2idx)
225 D = 80
226 K = 5
227
228 model = TNN(V, D, K, tf.nn.relu)
229 model.fit(train)
230 print("train accuracy:", model.score(None))
231 print("test accuracy:", model.score(test))
232
233
234if __name__ == '__main__':

Callers 1

Calls 4

fitMethod · 0.95
scoreMethod · 0.95
get_ptb_dataFunction · 0.90
TNNClass · 0.85

Tested by

no test coverage detected