DLNETWORK STATE IS ALWAYS A 0 TABLE.

조회 수: 5 (최근 30일)
Francesco Ruan
Francesco Ruan 2024년 1월 21일
답변: Ben 2024년 4월 9일
I am implemeting neural network, but when I define my Dlnetwork the State is always a 0 table, also during the training process in fact after the training my nerual structure isn't learning anything:
Below I show only a part of my code
%GENERATOR
lgraph_G = layerGraph;
Generator = [
sequenceInputLayer(30,"Name","sequence")
fullyConnectedLayer(512,"Name","DENSE_G1")
reluLayer("Name","relu_1")
fullyConnectedLayer(512,"Name","DENSE_G2")
reluLayer("Name","relu_2")
fullyConnectedLayer(512,"Name","DENSE_G4")
reluLayer("Name","relu_3")
fullyConnectedLayer(1,"Name","DENSE_G5")
];
lgraph_G = addLayers(lgraph_G,Generator);
netG = dlnetwork(Generator);
%DISCRIMINATORE
Discriminator = layerGraph(sequenceInputLayer(2,"Name","sequence"));
combined_D = [
fullyConnectedLayer(100,"Name","fc")
leakyReluLayer(0.2)
fullyConnectedLayer(100,"Name","fc_1")
leakyReluLayer(0.2)
fullyConnectedLayer(1,"Name","fc_2")
softplusLayer("Name","softplus")
];
Discriminator = addLayers(Discriminator,combined_D);
Discriminator = connectLayers(Discriminator,'sequence','fc');
Discriminator = dlnetwork(Discriminator);
combinde_D = layerGraph(combined_D);
lgraph_D = layerGraph(Discriminator);
netD = dlnetwork(lgraph_D);

답변 (1개)

Ben
Ben 2024년 4월 9일
This network does not have any layers with state parameters. The learnable parameters are in the netG.Learnables and netD.Learnables properties.
Some examples of layers with state are lstmLayer (which needs to pass its state from each sequence element to the next) or batchNormalizationLayer (which needs to pass its state from one minibatch to another).
You can define custom layers with state if you need to pass state information from the layer from one forward pass to another, see the custom layer documentation.

카테고리

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