'construct a convolutional neural network.
Keword Arguments:
- input_dim:             depth of features to be processed by first layer (no default)
- board:                 width of the go board to be processed (default 19)
- filters_per_layer:     number of filters used on every layer (default 128)
- filters_per_layer_K:   (where K is between 1 and <layers>) number of filters
used on layer K (default #filters_per_layer)
- layers:                number of convolutional steps (default 12)
- filter_width_K:        (where K is between 1 and <layers>) width of filter on
layer K (default 3 except 1st layer which defaults to 5).
Must be odd.'

@staticmethod
def create_network(**kwargs):

    defaults = {'board': 19, 'filters_per_layer': 128, 'layers': 12, 'filter_width_1': 5}
    params = defaults
    params.update(kwargs)
    network = Sequential()
    network.add(convolutional.Convolution2D(input_shape=(params['input_dim'], params['board'], params['board']), nb_filter=params.get('filters_per_layer_1', params['filters_per_layer']), nb_row=params['filter_width_1'], nb_col=params['filter_width_1'], init='uniform', activation='relu', border_mode='same'))
    for i in range(2, (params['layers'] + 1)):
        filter_key = ('filter_width_%d' % i)
        filter_width = params.get(filter_key, 3)
        filter_count_key = ('filters_per_layer_%d' % i)
        filter_nb = params.get(filter_count_key, params['filters_per_layer'])
        network.add(convolutional.Convolution2D(nb_filter=filter_nb, nb_row=filter_width, nb_col=filter_width, init='uniform', activation='relu', border_mode='same'))
    network.add(convolutional.Convolution2D(nb_filter=1, nb_row=1, nb_col=1, init='uniform', border_mode='same'))
    network.add(Flatten())
    network.add(Bias())
    network.add(Activation('softmax'))
    return network
