name: "alpha" layer { name: "mnist_cluttered" type: "ImageData" top: "data" top: "label" transform_param { scale: 0.00390625 } image_data_param { source: "mnist.txt" shuffle: true batch_size: 10 new_height: 28 new_width: 28 } } layer { name: "loc_conv1" type: "Convolution" bottom: "data" top: "loc_conv1" convolution_param { num_output: 20 kernel_size: 5 stride: 1 weight_filler { type: "xavier" } bias_filler { type: "constant" } } } layer { name: "loc_pool1" type: "Pooling" bottom: "loc_conv1" top: "loc_pool1" pooling_param { pool: MAX kernel_size: 2 stride: 2 } } layer { name: "loc_relu1" type: "ReLU" bottom: "loc_pool1" top: "loc_pool1" } layer { name: "loc_conv2" type: "Convolution" bottom: "loc_pool1" top: "loc_conv2" convolution_param { num_output: 20 kernel_size: 5 stride: 1 weight_filler { type: "xavier" } bias_filler { type: "constant" } } } layer { name: "loc_pool2" type: "Pooling" bottom: "loc_conv2" top: "loc_pool2" pooling_param { pool: MAX kernel_size: 2 stride: 2 } } layer { name: "loc_relu2" type: "ReLU" bottom: "loc_pool2" top: "loc_pool2" } layer { name: "loc_ip1" type: "InnerProduct" bottom: "loc_pool2" top: "loc_ip1" inner_product_param { num_output: 20 weight_filler { type: "xavier" } bias_filler { type: "constant" } } } layer { name: "loc_relu3" type: "ReLU" bottom: "loc_ip1" top: "loc_ip1" } layer { name: "loc_reg" type: "InnerProduct" bottom: "loc_ip1" top: "theta" inner_product_param { num_output: 6 weight_filler { type: "constant" value: 0 } bias_filler { type: "file" file: "bias_init.txt" } } } layer { name: "st_layer" type: "SpatialTransformer" bottom: "data" bottom: "theta" top: "st_output" st_param { to_compute_dU: false } } layer { name: "conv1" type: "Convolution" bottom: "st_output" top: "conv1" param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0 } convolution_param { num_output: 20 kernel_size: 5 stride: 1 weight_filler { type: "xavier" } bias_filler { type: "constant" } } } layer { name: "pool1" type: "Pooling" bottom: "conv1" top: "pool1" pooling_param { pool: MAX kernel_size: 2 stride: 2 } } #layer { # name: "dropout1" # type: "Dropout" # bottom: "pool1" # top: "dropout1" #} layer { name: "conv2" type: "Convolution" bottom: "pool1" top: "conv2" param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0 } convolution_param { num_output: 50 kernel_size: 5 stride: 1 weight_filler { type: "xavier" } bias_filler { type: "constant" } } } layer { name: "pool2" type: "Pooling" bottom: "conv2" top: "pool2" pooling_param { pool: MAX kernel_size: 2 stride: 2 } } #layer { # name: "dropout2" # type: "Dropout" # bottom: "pool2" # top: "dropout2" #} layer { name: "ip1" type: "InnerProduct" bottom: "pool2" top: "ip1" param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0 } inner_product_param { num_output: 500 weight_filler { type: "xavier" } bias_filler { type: "constant" } } } layer { name: "relu1" type:"ReLU" bottom: "ip1" top: "ip1" } layer { name: "ip2" type: "InnerProduct" bottom: "ip1" top: "ip2" param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0 } inner_product_param { num_output: 10 weight_filler { type: "xavier" } bias_filler { type: "constant" } } } layer { name: "relu2" type:"ReLU" bottom: "ip2" top: "ip2" } layer { name: "accuracy-test" type: "Accuracy" bottom: "ip2" bottom: "label" top: "accuracy" include: { phase: TEST } } layer { name: "accuracy-train" type: "Accuracy" bottom: "ip2" bottom: "label" top: "accuracy" include: { phase: TRAIN } } layer { name: "loss_cls" type: "SoftmaxWithLoss" bottom: "ip2" bottom: "label" top: "loss_cls" loss_weight: 1 }