test_v1.1
This commit is contained in:
@@ -1,6 +0,0 @@
|
||||
from tugo.encoders.base import *
|
||||
#from tugo.encoders.alphago import *
|
||||
#from tugo.encoders.betago import *
|
||||
from tugo.encoders.oneplane import *
|
||||
from tugo.encoders.sevenplane import *
|
||||
from tugo.encoders.simple import *
|
||||
|
||||
@@ -134,8 +134,3 @@ class AlphaGoEncoder(Encoder):
|
||||
|
||||
def shape(self):
|
||||
return self.num_planes, self.board_height, self.board_width
|
||||
|
||||
|
||||
def create(board_size):
|
||||
return AlphaGoEncoder(board_size)
|
||||
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
import unittest
|
||||
|
||||
from tugo.agent.helpers import is_point_an_eye
|
||||
from tugo.goboard_fast import Board, GameState, Move
|
||||
from tugo.gotypes import Player, Point
|
||||
from tugo.encoders.alphago import AlphaGoEncoder
|
||||
|
||||
|
||||
class AlphaGoEncoderTest(unittest.TestCase):
|
||||
def test_encoder(self):
|
||||
alphago = AlphaGoEncoder()
|
||||
|
||||
start = GameState.new_game(19)
|
||||
next_state = start.apply_move(Move.play(Point(16, 16)))
|
||||
alphago.encode(next_state)
|
||||
|
||||
self.assertEquals(alphago.name(), 'alphago')
|
||||
self.assertEquals(alphago.board_height, 19)
|
||||
self.assertEquals(alphago.board_width, 19)
|
||||
self.assertEquals(alphago.num_planes, 49)
|
||||
self.assertEquals(alphago.shape(), (49, 19, 19))
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
@@ -1,12 +1,4 @@
|
||||
# tag::importlib[]
|
||||
import importlib
|
||||
# end::importlib[]
|
||||
|
||||
__all__ = [
|
||||
'Encoder',
|
||||
'get_encoder_by_name',
|
||||
]
|
||||
|
||||
|
||||
# tag::base_encoder[]
|
||||
class Encoder:
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
# tag::oneplane_imports[]
|
||||
import numpy as np
|
||||
|
||||
from tugo.encoders.base import Encoder
|
||||
from tugo.goboard import Point
|
||||
# end::oneplane_imports[]
|
||||
|
||||
|
||||
|
||||
# tag::oneplane_encoder[]
|
||||
|
||||
Reference in New Issue
Block a user