Alexander Munch-Hansen
926a331df0
again and it is possible to play against the ai. There is no flag for this yet, so this has to be added.
60 lines
1.2 KiB
Python
60 lines
1.2 KiB
Python
from network import Network
|
|
import tensorflow as tf
|
|
import random
|
|
import numpy as np
|
|
|
|
|
|
from board import Board
|
|
|
|
import main
|
|
|
|
config = main.config.copy()
|
|
config['model'] = "player_testings"
|
|
config['ply'] = "1"
|
|
config['board_representation'] = 'quack-fat'
|
|
network = Network(config, config['model'])
|
|
|
|
network.restore_model()
|
|
initial_state = Board.initial_state
|
|
|
|
initial_state_1 = ( 0,
|
|
0, 0, 0, 2, 0, -5,
|
|
0, -3, 0, 0, 0, 0,
|
|
-5, 0, 0, 0, 3, 5,
|
|
0, 0, 0, 0, 5, -2,
|
|
0 )
|
|
|
|
initial_state_2 = ( 0,
|
|
-5, -5, -3, -2, 0, 0,
|
|
0, 0, 0, 0, 0, 0,
|
|
0, 0, 0, 15, 0, 0,
|
|
0, 0, 0, 0, 0, 0,
|
|
0 )
|
|
|
|
boards = {initial_state,
|
|
initial_state_1,
|
|
initial_state_2 }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# board = network.board_trans_func(Board.initial_state, 1)
|
|
|
|
|
|
# pair = network.make_move(Board.initial_state, [3,2], 1)
|
|
|
|
# print(pair[1])
|
|
|
|
# network.do_backprop(board, 0.9)
|
|
|
|
|
|
# network.print_variables()
|
|
|
|
|
|
# network.save_model(2)
|
|
|
|
# print(network.calculate_1_ply(Board.initial_state, [3,2], 1))
|
|
|
|
network.play_against_network() |