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

1 次查看(过去 30 天)
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]?

回答(1 个)

Ben
Ben 2024-4-9
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.

类别

Help CenterFile Exchange 中查找有关 Deep Learning Toolbox 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by