Make example applications pep8 compliant. (#553)

* Test examples for pep8 compliance.

* Make rl_pong example pep8 compliant.

* Make policy gradient example pep8 compliant.

* Make lbfgs example pep8 compliant.

* Make hyperopt example pep8 compliant.

* Make a3c example pep8 compliant.

* Make evolution strategies example pep8 compliant.

* Make resnet example pep8 compliant.

* Fix.
This commit is contained in:
Robert Nishihara
2017-05-16 14:12:18 -07:00
committed by Alexey Tumanov
parent 9018dffd7f
commit 3ebfd850e1
31 changed files with 1392 additions and 1192 deletions
+3
View File
@@ -10,6 +10,7 @@ from numpy.testing import assert_allclose
from reinforce.distributions import Categorical
from reinforce.utils import flatten, concatenate
class DistibutionsTest(unittest.TestCase):
def testCategorical(self):
@@ -28,6 +29,7 @@ class DistibutionsTest(unittest.TestCase):
probs = np.exp(z) / np.sum(np.exp(z))
self.assertTrue(np.sum(np.abs(probs - counts / num_samples)) <= 0.01)
class UtilsTest(unittest.TestCase):
def testFlatten(self):
@@ -54,5 +56,6 @@ class UtilsTest(unittest.TestCase):
assert_allclose(D["s"], np.array([0, 1, 4, 5]))
assert_allclose(D["a"], np.array([2, 3, 6, 7]))
if __name__ == "__main__":
unittest.main(verbosity=2)