Train Generative Adversarial Network (GAN) Example projectAndReshapeLayer

11 ビュー (過去 30 日間)
Darryl Tan
Darryl Tan 2021 年 7 月 18 日
回答済み: Hrishikesh Borate 2021 年 7 月 23 日
New to deep learning here, I was follwing the GAN example from: https://au.mathworks.com/help/deeplearning/ug/train-generative-adversarial-network.html
layersGenerator = [
featureInputLayer(numLatentInputs,'Name','in')
projectAndReshapeLayer(projectionSize,numLatentInputs,'Name','proj');
transposedConv2dLayer(filterSize,4*numFilters,'Name','tconv1')
batchNormalizationLayer('Name','bnorm1')
reluLayer('Name','relu1')
transposedConv2dLayer(filterSize,2*numFilters,'Stride',2,'Cropping','same','Name','tconv2')
batchNormalizationLayer('Name','bnorm2')
reluLayer('Name','relu2')
transposedConv2dLayer(filterSize,numFilters,'Stride',2,'Cropping','same','Name','tconv3')
batchNormalizationLayer('Name','bnorm3')
reluLayer('Name','relu3')
transposedConv2dLayer(filterSize,3,'Stride',2,'Cropping','same','Name','tconv4')
tanhLayer('Name','tanh')];
At the projectAndReshapeLayer() line reading:
'projectAndReshapeLayer' is used in the following examples:
Generate Synthetic Signals Using Conditional Generative Adversarial Network
Include Custom Layer in Network
Train Conditional Generative Adversarial Network (CGAN)
Train Generative Adversarial Network (GAN)
Train Wasserstein GAN with Gradient Penalty (WGAN-GP)
Error in GANtestrun (line 31)
projectAndReshapeLayer(projectionSize,numLatentInputs,'Name','proj');
I tried clicking on the train GAN example, I'm not sure what to make of it. projectionSize is defined at [4 4 512] and numLatentInputs is 100
I don't know what is the cause of error since Matlab isn't showing it.

回答 (1 件)

Hrishikesh Borate
Hrishikesh Borate 2021 年 7 月 23 日
Hi,
One possible reason for the occurrence of the error can be that the code is being executed from a directory where the projectAndReshapeLayer.m file is not located. To counter this error, execute the code from the directory which is accessed when the following command is executed in the Command Window.
openExample('nnet/TrainGenerativeAdversarialNetworkGANExample')

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by