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

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.

カテゴリ

ヘルプ センター および File ExchangeDeep Learning Toolbox についてさらに検索

タグ

質問済み:

2021 年 8 月 11 日

回答済み:

Ben
2024 年 4 月 9 日

Community Treasure Hunt

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

Start Hunting!

Translated by