Clear Filters
Clear Filters

I can't understand the generator network of the Train Generative Adversarial Network (GAN) example

2 views (last 30 days)
In the first layer of transposed convolution, why does it not use 'Stride',2,'Cropping','same' like the following layers? I think the width and height of the input is 4x4 so it needs to be enlarged by a factor of 2 for 4 times to get a size of 64x64. But in this code, I think it only enlarges the input by a factor of 2 for 3 times. Could you please help me understand this?
By the way, why it says 'Converts the random vectors of size 100 to 7-by-7-by-128 arrays using a project and reshape layer' but the projection size in the code is [4 4 512]?

Answers (1)

Ben
Ben on 9 Apr 2024
The documentation for transposedConv2dLayer states in the Algorithms section that the input is padded with zeros up to "filter edge size minus 1". I think this explains why the 4x4 input becomes 8x8. To see this, call analyzeNetwork(netG) on the generator in the example.
The statement "Converts the random vectors of size 100 to 7-by-7-by-128 arrays using a project and reshape layer" isn't in the current version of the example, perhaps it was a typo in an old version.

Categories

Find more on Deep Learning Toolbox in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!