def __init__(self, color="black", time_limit=5, gui=None, headless=False, strategy=OthelloHeuristic.DEFAULT_STRATEGY): super(ComputerPlayer, self).__init__(color, time_limit, gui, headless) heuristic = OthelloHeuristic(strategy) self.ai = GameArtificialIntelligence(heuristic.evaluate)
def __init__(self, color="black", time_limit=5, gui=None, headless=False, epochs=5, batch_size=100): super(DeepLearningPlayer, self).__init__(color, time_limit, gui, headless) self.model = Net() self.ai = GameArtificialIntelligence(self.evaluate_board); if torch.cuda.is_available(): self.model.cuda(0) print "CUDA activated" # print(self.model) try: self.model = DataHandler.load_weights(self.name) except Exception: if epochs != 0: self.train_model(epochs=epochs, batch_size=batch_size)
def __init__(self, color="black", time_limit=5, gui=None): super(ComputerPlayer, self).__init__(color, time_limit, gui) heuristic = OthelloHeuristic() self.ai = GameArtificialIntelligence(heuristic.evaluate)