How to turn Inner Product back to deconvolution layer

107 views
Skip to first unread message

Zhaopeng Xuan

unread,
Aug 22, 2016, 4:16:07 PM8/22/16
to Caffe Users
Hi,

A simple question, how could I turn a inner product layer back to deconvolution layer?

What I did is try to implement https://arxiv.org/ftp/arxiv/papers/1512/1512.01596.pdf, but after the deconvolution layer , the shape become batch_size * 4   , I hope to get batch_size * 4  * height * width

Following is what I did, thanks a lot

layer {
  name: "ip1deconde"
  type: "InnerProduct"
  bottom: "ip2encode"
  top: "ip1deconde"
  param {
    lr_mult: 2
    decay_mult: 1
  }
  param {
    lr_mult: 1
    decay_mult: 0
  }
  inner_product_param {
    num_output: 250
    weight_filler {
      type: "gaussian"
      std: 1
      sparse: 25
    }
    bias_filler {
      type: "constant"
    }
  }
}
layer {
  name: "deconv2"
  type: "Deconvolution"
  bottom: "ip1deconde"
  top: "deconv2"
  param {
    lr_mult: 2
    decay_mult: 1
  }
  param {
    lr_mult: 1
    decay_mult: 0
  }
  convolution_param {
    num_output: 4
    kernel_size: 12
    stride: 1
    weight_filler {
      type: "xavier"
    }
    bias_filler {
      type: "constant"
    }
  }
}




Zhaopeng Xuan

unread,
Aug 22, 2016, 6:33:23 PM8/22/16
to Caffe Users
I solve the problem by myself. In fact I should use Convolution layer instead of InnerProduct layer. Just change the filer as the output dimension of bottom input, then output should be 250 , then it will be 1*1*250 



Zhaopeng Xuan於 2016年8月22日星期一 UTC+2下午10時16分07秒寫道:

uttisht

unread,
Aug 22, 2016, 6:36:27 PM8/22/16
to Caffe Users
Check this out
Reply all
Reply to author
Forward
0 new messages