pile( loss = 'categorical_crossentropy ', Model.add(MaxPooling2D( pool_size =(nb_pool, nb_pool))) Model.add(Convolution2D(nb_filters, nb_conv, nb_conv)) Input_shape =(input_channels, go_board_rows, go_board_cols))) Model.add(Convolution2D(nb_filters, nb_conv, nb_conv, border_mode = 'valid ', Nb_conv = 3 # convolution kernel size # Specify a keras model with two convolutional layers and two dense layers, # connecting the (num_samples, 7, 19, 19) input to the 19*19 output vector. Nb_pool = 2 # size of pooling area for max pooling
Nb_filters = 32 # number of convolutional filters to use Go_board_rows, go_board_cols = 19, 19 # input dimensions of go board Nb_classes = 19 * 19 # One class for each position on the board The SevenPlaneProcessor, inspired by loads seven planes of 19*19 data points, three layers representing moves of varying liberties for each color and one capturing for ko. A regular Go board consists of 19 times 19 fields. We start by defining a Go data processor, which downloads an preprocesses Go games. The code for this example can be found in the examples folder.
The following example uses a convolutional neural network implemented in keras, but you are free to choose other libraries as well. Training and serving a bot can be done in just a few steps. Writing new Go data processing functionality.You can modify and extend any of the steps outlined above and help decrease the gap between AlphaGo and BetaGo, tear down walls and disrupt the establishment.