Пример #1
0
moves = []
white = True

for idx, move in enumerate(game.mainline_moves()):
    #print(moves)
    game_state = GameState(start_fen, moves)
    #print("Game state:")
    #print(game_state.as_string())
    moves.append(move.uci())
    print("FEN: %s" % (fen))
    fen = board.fen()
    print("Player move: %s" % (move))
    l = {}
    input = game_state.as_input(b1450)
    output_1450, = b1450.evaluate(input)
    output_2150, = b2150.evaluate(input)

    p_softmax_1450 = output_1450.p_softmax(*game_state.policy_indices())
    p_moves_1450 = list(zip(game_state.moves(), p_softmax_1450))
    #p_moves_1450.sort(key = lambda tup: tup[1], reverse=True)

    p_softmax_2150 = output_2150.p_softmax(*game_state.policy_indices())
    p_moves_2150 = list(zip(game_state.moves(), p_softmax_2150))
    #p_moves_2150.sort(key = lambda tup: tup[1], reverse=True)

    print([*p_softmax_1450])
    print([*p_softmax_2150])
    plt.scatter([*p_softmax_1450], [*p_softmax_2150], c='b')
    plt.plot([0, 1], [0, 1])
    for i, m in enumerate(game_state.moves()):