Train Generative Adversarial Network (GAN) Example projectAndReshapeLayer

조회 수: 21 (최근 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 CenterFile Exchange에서 Prototype Deep Learning Networks on FPGA에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by