Training Generative Adversarial Networks (GANs)

5 次查看(过去 30 天)
Here I have a GAN example
Here is the source of the case:
The structure of the generator is
filterSize = 5;
numFilters = 64;
numLatentInputs = 100;
projectionSize = [4 4 512];
layersGenerator = [
featureInputLayer(numLatentInputs)
projectAndReshapeLayer(projectionSize)
transposedConv2dLayer(filterSize,4*numFilters)
batchNormalizationLayer
reluLayer
transposedConv2dLayer(filterSize,2*numFilters,Stride=2,Cropping="same")
batchNormalizationLayer
reluLayer
transposedConv2dLayer(filterSize,numFilters,Stride=2,Cropping="same")
batchNormalizationLayer
reluLayer
transposedConv2dLayer(filterSize,3,Stride=2,Cropping="same")
tanhLayer];
The following error appears in the command line window:
'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 s3 (line 39)
projectAndReshapeLayer(projectionSize,numLatentInputs,'Name','proj');
I don't know why the error occurred? Hopes they can be informed

回答(1 个)

Amey Waghmare
Amey Waghmare 2023-1-4
Hi,
As per my understanding, you are facing an error for ‘projectAndReshapeLayer' while following the example Train Generative Adversarial Network (GAN).
‘projectAndReshapeLayer’ is a custom layer, and is provided as a part of this example, as mentioned in ‘Define Generative Adversarial Network’ section. In order to use this custom layer, you can open this example in MATLAB as a live script by typing the following in the Command Window,
openExample('nnet/TrainGenerativeAdversarialNetworkGANExample')
This will add the ‘projectAndReshapeLayer’ in the MATLAB path.

类别

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