OSDN Git Service

細かい見直し 仕上げ master
authoryamat0jp <yamat0jp@yahoo.co.jp>
Sat, 6 Jan 2018 00:22:33 +0000 (09:22 +0900)
committeryamat0jp <yamat0jp@yahoo.co.jp>
Sat, 6 Jan 2018 00:22:33 +0000 (09:22 +0900)
gote-model.hdf5
network.py
reversi.py
sente-model.hdf5

index 3f9e27c..0f61765 100644 (file)
Binary files a/gote-model.hdf5 and b/gote-model.hdf5 differ
index 6acb15f..49caf94 100644 (file)
@@ -49,7 +49,7 @@ class  Comp():
         X = np.reshape(np.float32(X),(1,64))
         Y = np.reshape(np.float32(Y),(1,64))
         self.model1.fit(X,Y)
-        res = self.model1.predict(X,0)
+        res = self.model1.predict(X,None,0)
         while True:
             s = np.argmax(res)
             if res[0][s] == 0:
@@ -70,7 +70,7 @@ class  Comp():
         X = np.reshape(np.float32(X),(1,64))
         Y = np.reshape(np.float32(Y),(1,64))
         self.model2.fit(X,Y)
-        res = self.model2.predict(X,0)
+        res = self.model2.predict(X,None,0)
         while True:
             s = np.argmax(res)
             if res[0][s] == 0:
index 65c8109..c844f43 100755 (executable)
@@ -115,14 +115,11 @@ class StoneGrid():
         return p[1]
                             
     def T_Data(self,stone):
-        x = False
         n = 0
         for i in range(8):
             for j in range(8):
                 self.CalScore(stone, i, j)
                 if self.score > 0:
-                    if x == False:
-                        x = True
                     self.arr.grid[i][j] = self.score
                     if self.score > n:
                         n = self.score
@@ -132,7 +129,7 @@ class StoneGrid():
             for i in range(8):
                 for j in range(8):
                     k = self.arr.grid[i][j]
-                    if k > 0:
+                    if k != 0:
                         self.arr.grid[i][j] = (n - k + 0.5) / n
     
     def Start(self):       
@@ -228,7 +225,7 @@ def CompStone():
     stone_grid.CanSetStone(index.stone, pre[0], pre[1], True)
     stone_grid.active = True
 
-if __name__ == '__main()__':
+if __name__ == '__main__':
     player1 = Player()
     player2 = Player()
     index = player1
index fcab123..25a148e 100644 (file)
Binary files a/sente-model.hdf5 and b/sente-model.hdf5 differ