wired behaviour in the Transposed Convolution Layer
Show older comments
Hello
This post if about the usage of transpose convolution layer in the following example:
https://uk.mathworks.com/help/deeplearning/ug/image-to-image-regression-using-deep-learning.html
In the createUpsampleTransposeConvLayer helper function numChannels = 1;
However, when the neural network is trained, the channel dimension of the weights of every transposed layer is greater than 1 as can be seen in the following image towards the highlighted weights on the right side:

I have manually checked the weights and they conform to the dimensions given in the above photo on the right side. Towards the left side it can be seen that the software mentions 4*4*1 transposed convolutions (assuming that the last digit is the number of channels) which is clearly wrong. So how can the transposed convolution layer, being told to keep the number of channels to 1, end up producing weights with channel dimensions greater than 1?
Secondly, I am trying to simulate this example by means of the dltranspconv function. I've tried to put number of channels =1 in the first convolution layer as follows:
O_dltconv1=dltranspconv(O_maxpool3,K_tconv_1,B_tconv_1,'Stride',2,'Cropping',1);
with:
K>> size(O_maxpool3)
ans =
4 4 8 500
K>> size(K_tconv_1)
ans =
4 4 8
K>> size(B_tconv_1)
ans =
1 1 8
but I get the following error:
Number of channels to convolve (1, specified by the size of the 'U' dimension of the weights) must be equal
to the size of the 'C' dimension of the input data (8).
If I go with the number of channels being greater than 1 approach (8 channels) which clearly seem to be right as per my first question, then the above simulation does not result in similar output as by using the layered arcitecture in the original example.
Please clarify this issue.
Accepted Answer
More Answers (0)
Categories
Find more on Logical in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!