Can we plot the output of in-between layers in deep neural network?

4 Ansichten (letzte 30 Tage)
I have a deep neural network having 297 layers. I want to visualize the output of some of the layers that are in-between this network for analysis purpose. Is it possible way to do that? Or should I create the network upto the layer where I want to take the output and plot the output using the 'plot' command?

Akzeptierte Antwort

Antoni Woss
Antoni Woss am 14 Sep. 2023
You can access the intermediate activations of a network by setting the name-value argument, Outputs, in the predict call. See the following documentation page for examples on this syntax: https://uk.mathworks.com/help/deeplearning/ref/dlnetwork.predict.html#d126e63879. You can select 1 or many layers for which to extract these intermediate activations using this name-value argument.
  2 Kommentare
BIPIN SAMUEL
BIPIN SAMUEL am 19 Sep. 2023
Bearbeitet: BIPIN SAMUEL am 19 Sep. 2023
Thank You @Antoni Woss, do we have to train again the network upto the layer where we want to get the output? or can we directly use "predict" command with argument 'Outputs' in the %Testing% session after %Training% the whole network?
Also, in function shown below what does "using any of the previous syntaxes" (in the comment session) means?
[Y1,...,YK] = predict(___,Outputs=layerNames) %returns the outputs Y1, …, YK during inference for the specified layers using any of the previous syntaxes.
Antoni Woss
Antoni Woss am 19 Sep. 2023
No, you do not need to retrain the network. The command will just returned the intermediate activations of the network passed to the function on the layer specified. If the network is a trained network, then the activations will be that of the trained network.
The "using any of the previous syntaxes" refers to the positional argument syntaxes in the documentation page. It means that you can use the name-value arguments with any of the previously defined syntaxes.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Deep Learning Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by