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

Function main

nlp_class2/rntn_tensorflow.py:237–250  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

235
236
237def 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
253if __name__ == '__main__':

Callers 1

rntn_tensorflow.pyFile · 0.70

Calls 4

fitMethod · 0.95
scoreMethod · 0.95
get_ptb_dataFunction · 0.90
RNTNClass · 0.85

Tested by

no test coverage detected