Fix probability distribution test
@@ -5,6 +5,7 @@ from __future__ import unicode_literals
import unittest
import numpy as np
+import time
from cleverhans.utils_keras import KerasModelWrapper
@@ -72,7 +73,7 @@ class TestKerasModelWrapper(unittest.TestCase):
p_val = self.sess.run(preds, feed_dict={x: x_val})
self.assertTrue(np.allclose(np.sum(p_val, axis=1), 1, atol=1e-6))
self.assertTrue(np.all(p_val>=0))
- self.assertTrue(np.all(p_val<=0))
+ self.assertTrue(np.all(p_val<=1))
def test_get_layer_names(self):
model = KerasModelWrapper(self.model)
@@ -96,6 +97,5 @@ class TestKerasModelWrapper(unittest.TestCase):
self.assertEqual(set(out_dict2.keys()), set(['l1', 'l2', 'softmax']))
self.assertEqual(int(out_dict2['l1'].shape[1]), 20)
-
if __name__ == '__main__':
unittest.main()
