Borrar filtros
Borrar filtros

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

8 visualizaciones (últimos 30 días)
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?

Respuesta aceptada

Antoni Woss
Antoni Woss el 14 de Sept. de 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 comentarios
BIPIN SAMUEL
BIPIN SAMUEL el 19 de Sept. de 2023
Editada: BIPIN SAMUEL el 19 de Sept. de 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 el 19 de Sept. de 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.

Iniciar sesión para comentar.

Más respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by