Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add deconvolution layer #46

Open
philtomson opened this issue Jan 21, 2015 · 3 comments
Open

Add deconvolution layer #46

philtomson opened this issue Jan 21, 2015 · 3 comments

Comments

@philtomson
Copy link

Need a layer for doing deconvolution.

@philtomson
Copy link
Author

It was mentioned in an email exchange that it may be as simple as swapping the forward and backward functions of the ConvolutionLayer to make a DeconvolutionLayer. What happens with n_filters, however? A convolution with n_filters = N creates N feature maps - how do those map back in the deconvolution?

@pluskid
Copy link
Owner

pluskid commented Jan 23, 2015

@philtomson I have pushed an implementation in the deconv branch, which added de conv support in convolution layer. You can have a look at that. In de convolution, nfilter also mean the number of channels in the target image. There is also a brief convolution.md if that makes thing a bit clear.

So conceptually it is reverting convolution layer, but actually more complicated than that. I have not merged it into master because the implementation is for cpu backend only. I'm still thinking about how to implement it for gpu as we currently invoke cudnn for gpu convolution.

@philtomson
Copy link
Author

@pluskid Thanks for adding this. We're wondering if there might be an error in backpropagation for the deconvolution layer (ConvolutionLayer with deconv=true). We keep seeing the Square loss go very rapidly towards Inf or NaN.

Network looks like this:


      NAME: ImageTrain
   BACKEND: CPUBackend

ARCHITECTURE: 5 layers
............................................................
*** MemoryDataLayer(data)
Outputs ---------------------------
data: Blob(750 x 750 x 3 x 10)
............................................................
*** MemoryDataLayer(label)
Outputs ---------------------------
label: Blob(750 x 750 x 10)
............................................................
*** ConvolutionLayer(conv1)
Inputs ----------------------------
data: Blob(750 x 750 x 3 x 10)
Outputs ---------------------------
conv: Blob(746 x 746 x 16 x 10)
............................................................
*** ConvolutionLayer(deconv)
Inputs ----------------------------
conv: Blob(746 x 746 x 16 x 10)
Outputs ---------------------------
deconv: Blob(750 x 750 x 1 x 10)
............................................................
*** SquareLossLayer(loss)
Inputs ----------------------------
deconv: Blob(750 x 750 x 1 x 10)
label: Blob(750 x 750 x 10)


23-Jan 16:06:05:INFO:root:
23-Jan 16:06:05:INFO:root:## Performance on Validation Set after 0 iterations
23-Jan 16:06:05:INFO:root:---------------------------------------------------------
23-Jan 16:06:05:INFO:root: Square-loss (avg over 10) = 77664.4219
23-Jan 16:06:05:INFO:root:---------------------------------------------------------
23-Jan 16:06:05:INFO:root:
23-Jan 16:07:54:INFO:root:000002 :: TRAIN obj-val = 1906052777742086025773056.00000000
23-Jan 16:10:16:INFO:root:
23-Jan 16:10:16:INFO:root:## Performance on Validation Set after 4 iterations
23-Jan 16:10:16:INFO:root:---------------------------------------------------------
23-Jan 16:10:16:INFO:root: Square-loss (avg over 10) = Inf
23-Jan 16:10:16:INFO:root:---------------------------------------------------------
23-Jan 16:10:16:INFO:root:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants