Is it possible to view the features of a dagnet network?

1 visualización (últimos 30 días)
Ashley
Ashley el 30 de Ag. de 2018
Respondida: Philip Brown el 4 de Mayo de 2023
I'm trying to create examples of images that 'strongly activate' channels of convolutional layers of a CNN (see https://www.mathworks.com/help/nnet/examples/visualize-features-of-a-convolutional-neural-network.html).
I've tried using the function deepDreamImage() but it only works for SeriesNetwork types, which I cannot use because my network has filters in parallel. Is there an equivalent function or workaround I can use for a DAGnetwork?
act1 = activations(net,im,'conv1','OutputAs','channels')
works on my network but produces greyscale outputs and I'm looking for color images.
I tried:
layer=5;
channels=1:8;
I = deepDreamImage(net,layer,channels,'PyramidLevels',1);
MatLab Error: Error using deepDreamImage Expected input number 1, network, to be one of these types: SeriesNetwork Instead its type was DAGNetwork.
Thanks!

Respuesta aceptada

Elif BAYKAL
Elif BAYKAL el 21 de Nov. de 2018
layer = 2;
name = net.Layers(layer).Name
net = SeriesNetwork(net.Layers);
channels = 1:56;
I = deepDreamImage(net,layer,channels,'PyramidLevels',1);
  1 comentario
Stuart Whipp
Stuart Whipp el 10 de Dic. de 2018
Does the above answer yorur question? I've developed a function for activations of recurrent networks such as LSTM. This could possibly be amended to work for DAGs, though in my experience the DAG layers are listed at the end, after output layers (in terms of layer index).
You'd want to ensure you were removing only the layers after the one you're interested in (in terms of layer architecture sequence not index) and I'm guessing the layer selected would have to follow an addition/depth concat layer otherwise there'd be two parallel/disparate outputs? In essence, this method applies a regression layer at the end of a sliced network and so will only output from one layer as though it was the penultimate layer of a net. Hope that makes sense!

Iniciar sesión para comentar.

Más respuestas (1)

Philip Brown
Philip Brown el 4 de Mayo de 2023
If you're looking for using the deepDreamImage function for DAGNetwork networks, that's supported from R2019b.

Categorías

Más información sobre Deep Learning Toolbox en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by