3

I am trying to understand how the shape of the image changes after deconvolution ? I am trying to understand the example code of convolutional autoencoder from neon.

```
layers = [Conv((4, 4, 8), init=init_uni, activation=Rectlin()),
Pooling(2),
Conv((4, 4, 32), init=init_uni, activation=Rectlin()),
Pooling(2),
Deconv(fshape=(3, 3, 8), init=init_uni, strides=2, padding=1),
Deconv(fshape=(3, 3, 8), init=init_uni, strides=2, padding=1),
Deconv(fshape=(4, 4, 1), init=init_uni, strides=2, padding=0)]
```

The input_shapes and output_shapes of each layer are as follows

```
Convolution Layer 'ConvolutionLayer': 1 x (28x28) inputs, 8 x (25x25) outputs, padding 0, stride 1
Pooling Layer 'PoolingLayer': 8 x (25x25) inputs, 8 x (12x12) outputs
Convolution Layer 'ConvolutionLayer': 8 x (12x12) inputs, 32 x (9x9) outputs, padding 0, stride 1
Pooling Layer 'PoolingLayer': 32 x (9x9) inputs, 32 x (4x4) outputs
Deconvolution Layer 'DeconvolutionLayer': 32 x (4x4) inputs, 8 x (7x7) outputs
Deconvolution Layer 'DeconvolutionLayer': 8 x (7x7) inputs, 8 x (13x13) outputs
Deconvolution Layer 'DeconvolutionLayer': 8 x (13x13) inputs, 1 x (28x28) outputs
```

I understand how the shapes change after convolution ('valid'). (Thanks to http://cs231n.github.io/convolutional-networks/) How does the stride affect the size of matrix when deconvolution (full convolution) is used ?

See also: What are deconvolutional layers?

– Martin Thoma – 2016-11-22T21:29:47.450Check out my answer here for your question.

– Yash Katariya – 2017-07-20T08:32:36.887