Thanks to read this. I have developed chess AI like AlphaGo Lee or AlphaGo Zero. I have used Python and tensorflow. The chess AI is consist of Montecarlo-Tree-Search, policy network and value network.
I did learning for policy and value network for Montecarlo tree search. There is no problem. but, Each Simulation in Montecarlo tree search is too slow. So I want to boost each simulation speed.
I have known that python doesn't share object because of GIL. I really need to help for that. If you guys have a experience about share object in python multiprocessing, Please share your experience.
I post summary code below this page.
p.s : I'm not good at english. So, If you are uncomfortable at reading this page, that's my fault. please understand that.
class monte
#I want to share Tree in multiprocessing
tree = Tree()
def doMontecarloTreeSearch:
while numberOfsimulation:
#I want to boost speed each simulation
# but each search() computing neural network to make new node
# so they spend much time.
search()
def search:
#node is created in each selection and is added in tree
while is_gameover():
selection()
evaluation()
backpropagation()
def selection
#add best value node in Tree
def evaluation
#each node is evaluated for expasion
def backpropagation
# after gameove, leaf node backpropagate gameresult
# and patent nodes are updated util parent node is root node