Generate a few samples using the fast method and perform sanity checks on the output.
(self)
| 32 | self.assertTrue(np.all((proba >= 0) & (proba <= (128 - 1)))) |
| 33 | |
| 34 | def testGenerateFast(self): |
| 35 | '''Generate a few samples using the fast method and |
| 36 | perform sanity checks on the output.''' |
| 37 | waveform = tf.placeholder(tf.int32) |
| 38 | np.random.seed(0) |
| 39 | data = np.random.randint(128) |
| 40 | proba = self.net.predict_proba_incremental(waveform) |
| 41 | |
| 42 | with self.test_session() as sess: |
| 43 | sess.run(tf.global_variables_initializer()) |
| 44 | sess.run(self.net.init_ops) |
| 45 | proba = sess.run(proba, feed_dict={waveform: data}) |
| 46 | |
| 47 | self.assertAllEqual(proba.shape, [128]) |
| 48 | self.assertTrue(np.all((proba >= 0) & (proba <= (128 - 1)))) |
| 49 | |
| 50 | def testCompareSimpleFast(self): |
| 51 | waveform = tf.placeholder(tf.int32) |
nothing calls this directly
no test coverage detected