Add the SuperMLP class

This commit is contained in:
D-X-Y
2021-03-19 03:22:58 -07:00
parent 51c626c96d
commit 31b8122cc1
6 changed files with 195 additions and 53 deletions

View File

@@ -48,7 +48,7 @@ class TestBasicSpace(unittest.TestCase):
space = Continuous(lower, upper, log=False)
values = []
for i in range(1000000):
x = space.random().value
x = space.random(reuse_last=False).value
self.assertGreaterEqual(x, lower)
self.assertGreaterEqual(upper, x)
values.append(x)
@@ -97,6 +97,12 @@ class TestBasicSpace(unittest.TestCase):
self.assertTrue(is_determined(1))
self.assertFalse(is_determined(nested_space))
def test_duplicate(self):
space = Categorical(1, 2, 3, 4)
x = space.random()
for _ in range(100):
self.assertEqual(x, space.random(reuse_last=True))
class TestAbstractSpace(unittest.TestCase):
"""Test the abstract search spaces."""