mirror of
https://github.com/wassname/ray.git
synced 2026-09-12 12:51:15 +08:00
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:
committed by
Alexey Tumanov
parent
9018dffd7f
commit
3ebfd850e1
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user