Python features.liberty_feature() Examples

The following are 7 code examples of features.liberty_feature(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module features , or try the search function .
Example #1
Source File: test_features.py    From training_results_v0.5 with Apache License 2.0 5 votes vote down vote up
def test_liberty_feature(self):
        f = features.liberty_feature(TEST_POSITION)
        self.assertEqual(f.shape, (9, 9, features.liberty_feature.planes))

        self.assertEqual(f[0, 0, 0], 0)
        # the stone at 0, 1 has 3 liberties.
        self.assertEqual(f[0, 1, 2], 1)
        self.assertEqual(f[0, 1, 4], 0)
        # the group at 0, 7 has 3 liberties
        self.assertEqual(f[0, 7, 2], 1)
        self.assertEqual(f[0, 8, 2], 1)
        # the group at 1, 0 has 18 liberties
        self.assertEqual(f[1, 0, 7], 1) 
Example #2
Source File: test_features.py    From training_results_v0.5 with Apache License 2.0 5 votes vote down vote up
def test_liberty_feature(self):
        f = features.liberty_feature(TEST_POSITION)
        self.assertEqual(f.shape, (9, 9, features.liberty_feature.planes))

        self.assertEqual(f[0, 0, 0], 0)
        # the stone at 0, 1 has 3 liberties.
        self.assertEqual(f[0, 1, 2], 1)
        self.assertEqual(f[0, 1, 4], 0)
        # the group at 0, 7 has 3 liberties
        self.assertEqual(f[0, 7, 2], 1)
        self.assertEqual(f[0, 8, 2], 1)
        # the group at 1, 0 has 18 liberties
        self.assertEqual(f[1, 0, 7], 1) 
Example #3
Source File: test_features.py    From alphago_demo with Apache License 2.0 5 votes vote down vote up
def test_liberty_feature(self):
        f = features.liberty_feature(TEST_POSITION)
        self.assertEqual(f.shape, (9, 9, features.liberty_feature.planes))

        self.assertEqual(f[0, 0, 0], 0)
        # the stone at 0, 1 has 3 liberties.
        self.assertEqual(f[0, 1, 2], 1)
        self.assertEqual(f[0, 1, 4], 0)
        # the group at 0, 7 has 3 liberties
        self.assertEqual(f[0, 7, 2], 1)
        self.assertEqual(f[0, 8, 2], 1)
        # the group at 1, 0 has 18 liberties
        self.assertEqual(f[1, 0, 7], 1) 
Example #4
Source File: test_features.py    From MuGo with Apache License 2.0 5 votes vote down vote up
def test_liberty_feature(self):
        f = features.liberty_feature(TEST_POSITION)
        self.assertEqual(f.shape, (9, 9, features.liberty_feature.planes))

        self.assertEqual(f[0, 0, 0], 0)
        # the stone at 0, 1 has 3 liberties.
        self.assertEqual(f[0, 1, 2], 1)
        self.assertEqual(f[0, 1, 4], 0)
        # the group at 0, 7 has 3 liberties
        self.assertEqual(f[0, 7, 2], 1)
        self.assertEqual(f[0, 8, 2], 1)
        # the group at 1, 0 has 18 liberties
        self.assertEqual(f[1, 0, 7], 1) 
Example #5
Source File: test_features.py    From training with Apache License 2.0 5 votes vote down vote up
def test_liberty_feature(self):
        f = features.liberty_feature(TEST_POSITION)
        self.assertEqual(f.shape, (9, 9, features.liberty_feature.planes))

        self.assertEqual(0, f[0, 0, 0])
        # the stone at 0, 1 has 3 liberties.
        self.assertEqual(1, f[0, 1, 2])
        self.assertEqual(0, f[0, 1, 4])
        # the group at 0, 7 has 3 liberties
        self.assertEqual(1, f[0, 7, 2])
        self.assertEqual(1, f[0, 8, 2])
        # the group at 1, 0 has 18 liberties
        self.assertEqual(1, f[1, 0, 7]) 
Example #6
Source File: test_features.py    From AlphaGOZero-python-tensorflow with MIT License 5 votes vote down vote up
def test_liberty_feature(self):
        f = features.liberty_feature(TEST_POSITION)
        self.assertEqual(f.shape, (9, 9, features.liberty_feature.planes))

        self.assertEqual(f[0, 0, 0], 0)
        # the stone at 0, 1 has 3 liberties.
        self.assertEqual(f[0, 1, 2], 1)
        self.assertEqual(f[0, 1, 4], 0)
        # the group at 0, 7 has 3 liberties
        self.assertEqual(f[0, 7, 2], 1)
        self.assertEqual(f[0, 8, 2], 1)
        # the group at 1, 0 has 18 liberties
        self.assertEqual(f[1, 0, 7], 1) 
Example #7
Source File: test_features.py    From AlphaGOZero-python-tensorflow with MIT License 5 votes vote down vote up
def test_liberty_feature(self):
        f = features.liberty_feature(TEST_POSITION)
        self.assertEqual(f.shape, (9, 9, features.liberty_feature.planes))

        self.assertEqual(f[0, 0, 0], 0)
        # the stone at 0, 1 has 3 liberties.
        self.assertEqual(f[0, 1, 2], 1)
        self.assertEqual(f[0, 1, 4], 0)
        # the group at 0, 7 has 3 liberties
        self.assertEqual(f[0, 7, 2], 1)
        self.assertEqual(f[0, 8, 2], 1)
        # the group at 1, 0 has 18 liberties
        self.assertEqual(f[1, 0, 7], 1)