for j in range(1000): MCTS(current) data = torch.FloatTensor(StateToImg(current)).unsqueeze(0) print(net(Variable(data)).data[0, 0]) best = current.child[0] for c in current.child: if c.n > best.n: best = c move2 = current.moves[current.child.index(best)] GUI.Move(move2, current.pos[move2[0]]) current = best data = torch.FloatTensor(StateToImg(current)).unsqueeze(0) print(net(Variable(data)).data[0, 0]) if current.mandatory: for move2 in current.moves: GUI.SetBoard(True, *move2) break f = torch.load(PATH_PARAM) net.load_state_dict(f) net.eval() for i in range(50): MCTS(current) GUI = Graphics(Callback) GUI.Run()