Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

How to visualize deep neural network?

1 vue (au cours des 30 derniers jours)
mohammed mahmoud
mohammed mahmoud le 13 Mai 2018
Clôturé : MATLAB Answer Bot le 20 Août 2021
I want to draw the model as image.
netD = dagnn.DagNN();
i = 0;
% 64x64 to 32x32
conv_param = struct('f', [4 4 3 64], 'pad', 1, 'stride', 2, 'bias', false);
relu_param = 0.2;
i = i+1; netD = get_Conv_dag(netD, i, 'data', sprintf('x%d',i), conv_param);
i = i+1; netD = get_ReLU_dag(netD, i, sprintf('x%d',i-1), sprintf('x%d',i), relu_param);
% 32x32 to 16x16
conv_param = struct('f', [4 4 64 64*2], 'pad', 1, 'stride', 2, 'bias', false);
bn_param = struct('depth', 64*2, 'epsilon', 1e-5);
[netD, i] = get_Block_CBR( netD, i, conv_param, bn_param,relu_param); % 1
% 16x16 to 8x8
conv_param = struct('f', [4 4 64*2 64*4], 'pad', 1, 'stride', 2, 'bias', false);
bn_param = struct('depth', 64*4, 'epsilon', 1e-5);
[netD, i] = get_Block_CBR( netD, i, conv_param, bn_param,relu_param); % 1
% 8x8 to 4x4
conv_param = struct('f', [4 4 64*4 64*8], 'pad', 1, 'stride', 2, 'bias', false);
bn_param = struct('depth', 64*8, 'epsilon', 1e-5);
[netD, i] = get_Block_CBR( netD, i, conv_param, bn_param,relu_param); % 1
% 4x4 to 1x1
conv_param = struct('f', [4 4 64*8 1], 'pad', 0, 'stride', 2, 'bias', false);
i = i+1; netD = get_Conv_dag(netD, i, sprintf('x%d',i-1), sprintf('x%d',i), conv_param);
i = i+1; netD.addLayer('D_loss', dagnn.Loss('loss', 'logistic'), { sprintf('x%d',i-1),'label'},'logistic');
netD.initParams();
netD.meta.trainOpts = opts.train;

Réponses (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by