'Initializes kernels and biases for this convolutional net.
Parameters used to construct the network:
depths: comma separated list of ints, number of channels input to the
convolutional kernel at every layer.
widths: comma separated list of ints, number of steps input to the
convolutional kernel at every layer.
relu_layers: comma separate list of ints, the id of layers after which
to apply a relu activation. *By default, all but the final layer will
have a relu activation applied.*
To generate a network with M layers, both \'depths\' and \'widths\' must be of
length M. The input depth of the first layer is inferred from the total
concatenated size of the input features.
Args:
component: parent ComponentBuilderBase object.
Raises:
RuntimeError: if the number of depths and weights are not equal.
ValueError: if the final depth is not equal to 1.'

def __init__(self, component):

    parameters = component.spec.network_unit.parameters
    super(PairwiseConvNetwork, self).__init__(component)
    self._depths = [(self._concatenated_input_dim * 2)]
    self._depths.extend(map(int, parameters['depths'].split(',')))
    self._widths = map(int, parameters['widths'].split(','))
    self._num_layers = len(self._widths)
    if (len(self._depths) != (self._num_layers + 1)):
        raise RuntimeError(('Unmatched    depths/weights    %s/%s' % (parameters['depths'], parameters['weights'])))
    if (self._depths[(-1)] != 1):
        raise ValueError(('Final    depth    is    not    equal    to    1    in    %s' % parameters['depths']))
    self._kernel_shapes = []
    for (i, width) in enumerate(self._widths):
        self._kernel_shapes.append([width, width, self._depths[i], self._depths[(i + 1)]])
    if parameters['relu_layers']:
        self._relu_layers = set(map(int, parameters['relu_layers'].split(',')))
    else:
        self._relu_layers = set(range((self._num_layers - 1)))
    self._weights = []
    self._biases = []
    for (i, kernel_shape) in enumerate(self._kernel_shapes):
        with tf.variable_scope(('conv%d' % i)):
            self._weights.append(tf.get_variable('weights', kernel_shape, initializer=tf.random_normal_initializer(stddev=0.0001), dtype=tf.float32))
            bias_init = (0.0 if (i in self._relu_layers) else 0.2)
            self._biases.append(tf.get_variable('biases', kernel_shape[(-1)], initializer=tf.constant_initializer(bias_init), dtype=tf.float32))
    self._params.extend((self._weights + self._biases))
    self._layers.append(Layer(component, name='conv_output', dim=(-1)))
    self._regularized_weights.extend(self._weights[:(-1)])
