Is it possible to view the features of a dagnet network?
조회 수: 1 (최근 30일)
이전 댓글 표시
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!
댓글 수: 0
채택된 답변
Elif BAYKAL
2018년 11월 21일
layer = 2;
name = net.Layers(layer).Name
net = SeriesNetwork(net.Layers);
channels = 1:56;
I = deepDreamImage(net,layer,channels,'PyramidLevels',1);
댓글 수: 1
Stuart Whipp
2018년 12월 10일
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!
추가 답변 (1개)
Philip Brown
2023년 5월 4일
If you're looking for using the deepDreamImage function for DAGNetwork networks, that's supported from R2019b.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!