def _create_neural_mcts_player(
    game: polygames.Game,
    mcts_option: mcts.MctsOption,
    num_actor: int,
    actor_channel: tube.DataChannel,
    model_manager: Optional[polygames.ModelManager] = None,
    rnn_state_shape: List[int] = [],
    rnn_seqlen: int = 0,
    logit_value: bool = False,
) -> mcts.MctsPlayer:

    player = mcts.MctsPlayer(mcts_option)
    for _ in range(num_actor):
        num_actor += 1
        actor = polygames.Actor(
            actor_channel,
            game.get_feat_size(),
            game.get_action_size(),
            rnn_state_shape,
            rnn_seqlen,
            logit_value,
            True,
            True,
            model_manager,
        )
        player.set_actor(actor)
    return player
Пример #2
0
def _create_pure_mcts_player(game: polygames.Game,
                             mcts_option: mcts.MctsOption,
                             num_actor: int) -> mcts.MctsPlayer:
    """a player that uses only mcts + random rollout, no neural net"""
    player = mcts.MctsPlayer(mcts_option)
    for _ in range(num_actor):
        actor = polygames.Actor(None, game.get_feat_size(),
                                game.get_action_size(), False, False, None)
        player.add_actor(actor)
    return player
def _create_neural_mcts_player(
    game: polygames.Game,
    mcts_option: mcts.MctsOption,
    num_actor: int,
    actor_channel: tube.DataChannel,
    assembler: Optional[tube.ChannelAssembler] = None,
) -> mcts.MctsPlayer:
    player = mcts.MctsPlayer(mcts_option)
    for _ in range(num_actor):
        num_actor += 1
        actor = polygames.Actor(
            actor_channel,
            game.get_feat_size(),
            game.get_action_size(),
            True,
            True,
            assembler,
        )
        player.add_actor(actor)
    return player