Пример #1
0
 def __init__(self, model, encoder):
     Agent.__init__(self)
     self._model = model
     self._encoder = encoder
     self._collector = None
     self._temperature = 0.0
     board = goboard.Board(19, 19)
     self.board_ext = goboard.Board_Ext(board)
Пример #2
0
    def __init__(self,
                 policy_agent,
                 fast_policy_agent,
                 value_agent,
                 lambda_value=0.5,
                 num_simulations=1000,
                 depth=50,
                 rollout_limit=100):
        Agent.__init__(self)
        self.policy = policy_agent
        self.rollout_policy = fast_policy_agent
        self.value = value_agent

        self.lambda_value = lambda_value
        self.num_simulations = num_simulations
        self.depth = depth
        self.rollout_limit = rollout_limit
        self.root = AlphaGoNode()
Пример #3
0
 def __init__(self, model, encoder):
     Agent.__init__(self)
     self.model = model
     self.encoder = encoder
Пример #4
0
 def __init__(self, model, encoder):
     Agent.__init__(self)
     self._model = model
     self._encoder = encoder
     self._collector = None
Пример #5
0
 def __init__(self):
     Agent.__init__(self)
     self.dim = None
     self.point_cache = []
Пример #6
0
 def __init__(self, agent, strategy=None):
     Agent.__init__(self)
     self.agent = agent
     self.strategy = strategy if strategy is not None \
         else TerminationStrategy()
Пример #7
0
 def __init__(self, max_depth, eval_fn):
     Agent.__init__(self)
     self.max_depth = max_depth
     self.eval_fn = eval_fn
Пример #8
0
 def __init__(self, num_rounds, temperature):
     Agent.__init__(self)
     self.num_rounds = num_rounds
     self.temperature = temperature
Пример #9
0
 def __init__(self, model, encoder):
     Agent.__init__(self)
     self._model = model  # A Keras Sequential model instance
     self._encoder = encoder  # Implements the Encoder interface
     self._collector = None
     self._temperature = 0.0
 def __init__(self):
     Agent.__init__(self)
     self.model = nn.DataParallel(Model()).to(device)
     checkpoint = torch.load("go_model.pt")
     self.model.module.load_state_dict(checkpoint["model_state_dict"])
Пример #11
0
 def __init__(self, model, encoder, print_probs = False):
     Agent.__init__(self)
     self.model = model
     self.encoder = encoder
     self.print_probs = print_probs