def genConvLayer(train_val, name, bottom, kernel_size, num_output, stride, pad, bias_term=False, filler='msra'):
    layer_str = '\nlayer {{\n  name: "{name}"\n  type: "Convolution"\n  bottom: "{bottom}"\n  top: "{top}"\n  convolution_param {{\n    num_output: {num_output}\n    kernel_size: {kernel_size}\n    stride: {stride}\n    pad: {pad}\n    weight_filler {{\n      type: "{weight_filler_type}"\n      std: 0.010\n    }}'.format(name=name, top=name, bottom=bottom, kernel_size=kernel_size, num_output=num_output, pad=pad, stride=stride, weight_filler_type=filler)
    if bias_term:
        layer_str = (layer_str + '\n    bias_filler {\n      type: "constant"\n      value: 0\n    }\n  }\n}')
    else:
        layer_str = (layer_str + '\n    bias_term: false\n  }\n}')
    train_val += layer_str
    return (train_val, name)
def genConvLayer(train_val, name, bottom, kernel_size, num_output, stride, pad, bias_term=False, filler='msra'):
    layer_str = '\nlayer {{\n  name: "{name}"\n  type: "Convolution"\n  bottom: "{bottom}"\n  top: "{top}"\n  convolution_param {{\n    num_output: {num_output}\n    kernel_size: {kernel_size}\n    stride: {stride}\n    pad: {pad}\n    weight_filler {{\n      type: "{weight_filler_type}"\n      std: 0.010\n    }}'.format(name=name, top=name, bottom=bottom, kernel_size=kernel_size, num_output=num_output, pad=pad, stride=stride, weight_filler_type=filler)
    if bias_term:
        layer_str = (layer_str + '\n    bias_filler {\n      type: "constant"\n      value: 0\n    }\n  }\n}')
    else:
        layer_str = (layer_str + '\n    bias_term: false\n  }\n}')
    train_val += layer_str
    return (train_val, name)