MCPcopy Create free account
hub / github.com/tensorflow/tfjs-examples / testTrainLSTMModel

Method testTrainLSTMModel

sentiment/python/imdb_test.py:60–75  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

58 imdb.indices_to_words(reverse_index, indices))
59
60 def testTrainLSTMModel(self):
61 data_size = 10
62 x_train = np.random.randint(0, 100, (data_size,))
63 y_train = np.random.randint(0, 2, (data_size,))
64 x_test = np.random.randint(0, 100, (data_size,))
65 y_test = np.random.randint(0, 2, (data_size,))
66
67 vocabulary_size = 100
68 embedding_size = 32
69 epochs = 1
70 batch_size = data_size
71 model = imdb.train_model(
72 'lstm', vocabulary_size, embedding_size,
73 x_train, y_train, x_test, y_test,
74 epochs, batch_size)
75 self.assertTrue(model.layers)
76
77 def testTrainModelWithInvalidModelTypeRaisesError(self):
78 data_size = 10

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected