In model.py, the Keras imports are as follows:
from keras.models import Sequential, load_model, Modelfrom keras.layers import Input, Dense, Conv2D, Flatten, BatchNormalization, Activation, LeakyReLU, addfrom keras.optimizers import SGDfrom keras import regularizers
The four key model-building methods are:
def residual_layer(self, input_block, filters, kernel_size)def conv_layer(self, x, filters, kernel_size)def value_head(self, x)def policy_head(self, x)
They all have one or more Conv2d layers followed by BatchNormalization and LeakyReLU activation, as shown in Figure 10.1, but value_head and policy_head also have fully-connected layers, as shown in Figure 10.2, after the convolutional layers to generate ...