maxpumperla / deep_learning_and_the_game_of_go

Code and other material for the book "Deep Learning and the Game of Go"
https://www.manning.com/books/deep-learning-and-the-game-of-go
989 stars 390 forks source link

How do I play against alphabeta bot? #19

Open aletote opened 5 years ago

aletote commented 5 years ago

I would like to test it out but how do I replace the random bot with it in human_v_bot.py?

When I want to call it I dont know what to pass as eval_fn argument.

macfergus commented 5 years ago

Hi aletote, you can use any function that is suitable for the DepthPrunedAgent: it should just take a GameState argument, and return a score indicating how good the state is from the perspective of the next player to paly. For example, you can copy the capture_diff function from pruned_go.py.

I just pushed an update to the chatper_4 branch including an example interactive program, see here: https://github.com/maxpumperla/deep_learning_and_the_game_of_go/blob/chapter_4/code/alpha_beta_go.py It plays on a 5x5 board cause the implementation is fairly slow.