필터 지우기
필터 지우기

Retrieving activation data results for intermediate layers of a shallow neural network

조회 수: 21 (최근 30일)
Hi everyone,
I am looking for a function or another straightforward way to retrieve intermediate layer results (e.g. from the bottleneck layer) when training a shallow neural network which looks like this:
net = feedforwardnet(hiddenLayers,trainFcn)
net = configure(net,X,X);
net = train(net,X,X)
X_afterNN = net(X)
X are a series of modal parameters from a structure (i.e. input data that are not images) and I'd like to retrieve and further examine the intermediate outcomes of my NN.
In other words, I'm looking for an equivalent to the 'activations' function which works for deployed deep learning networks and returns intermediate layer activations for an image data and a specified layer, that is:
act = activations(workflowObject,image,layername)
Thank you for your help!

채택된 답변

Varun Sai Alaparthi
Varun Sai Alaparthi 2023년 1월 16일
Hello Ana,
Unfortunately, there is no direct function or straightforward approach as of MATLAB R2022b to directly get output of an intermediate layer of a shallow neural network.
However, as a workaround you can try to use the dlnetwork class using which you can directly use the 'predict' function to get the output of any intermediate layer of the network.
[Y1,Y2,..] = predict(___,'Outputs',layerNames);
Use this code snippet to get the output of the specified layer
If you have any further queries, please feel free to reply to my answer
  댓글 수: 1
gengoroshop gengoroshop
gengoroshop gengoroshop 2023년 6월 13일
This did not work for me. Can you please explain how to obtain outputs from intermeiate layers with an example of gloogLenet?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by