Train Generative Adversarial Network (GAN)
显示 更早的评论
I played around with the GAN-Example at
and it works without any problems when just running the software.
I now modified the layersGenerator with an additional fullyConnectedLayer just after the imageInputLayer
imageInputLayer([1 1 numLatentInputs],'Normalization','none','Name','in')
fullyConnectedLayer(numLatentInputs,'Name','fc'); % <- this line is new, nothing special
transposedConv2dLayer(filterSize,8*numFilters,'Name','tconv1')
...
even though analyzeNework seems to be fine with it (the outcome also provides a [1 1 100] dimensional array
learning fails with the comment
"Invalid input data. Convolution operation is supported only for 1, 2, or 3 spatial dimensions."
Do you have any ideas or workarounds how to handle this?
采纳的回答
更多回答(3 个)
Bodo Rosenhahn
2019-12-2
0 个投票
1 个评论
Raunak Gupta
2019-12-2
Hi,
The FC layer will only generate a single dimension output, you may check by
outputSize = lgraphGenerator.Layers(2).OutputSize
Here Layers(2) represents FC layer. analyzeNetwork will say that its dimension as 1x1x100 but its actually 100. At the end part of Network these single dimension output doesn't cause any error. The FC layer is designed in such way that it is usable only at the end part because its usability. As for the bottleneck layers of Autoencoder, currently we have segnetLayers and unetLayers which does not contain FC Layers in bottleneck part.
That is why I suggested moving to convolution2dLayer to acheive the same functionality.
For dlnetwork it is used so that writing custom loops won't create problems related to dlarrays.
Hope this clarifies some queries.
Bodo Rosenhahn
2019-12-4
0 个投票
1 个评论
Raunak Gupta
2019-12-5
Hi,
You have accepted your Answer, It will mislead any user coming to this question as your answer didn't provide any solution. It would be helpful if you unaccept above answer and accept the actual answer if that one worked for you.
MEP
2020-1-23
0 个投票
Hi, i need to use the GAN but my input data is a matrix of acceleration signals where each row contain the samples of the signal. So in each row i have different signals, how can i put it in input? I can put it as a matrix or i need to separate the matrix in array and put single array? Thanks...
类别
在 帮助中心 和 File Exchange 中查找有关 Deep Learning Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!