caffe Python API 之上卷积层(Deconvolution)

对于convolution:

output = (input + 2 * p  - k)  / s + 1;

对于deconvolution:

output = (input - 1) * s + k - 2 * p;

net.deconv = caffe.layers.Deconvolution(
    net.conv1,
    param={"lr_mult": 1, "decay_mult": 1},
    convolution_param=dict(
        num_output=10,
        stride=32,
        kernel_size=64,
        bias_term=False,
        weight_filler=dict(type="xavier" ),
        bias_filler=dict(type='constant', value=0))
)

输出:
layer {
  name: "deconv"
  type: "Deconvolution"
  bottom: "conv1"
  top: "deconv"
  param {
    lr_mult: 1
    decay_mult: 1
  }
  convolution_param {
    num_output: 10
    bias_term: false
    kernel_size: 64
    stride: 32
    weight_filler {
      type: "xavier"
    }
    bias_filler {
      type: "constant"
      value: 0
    }
  }

 

posted @ 2018-11-06 09:36  HOU_JUN  阅读(1726)  评论(0编辑  收藏  举报