How can I plot a neural network?

조회 수: 30 (최근 30일)
Franck Dernoncourt
Franck Dernoncourt 2013년 1월 22일
답변: Sajjad Shawl 2022년 6월 5일
Say I created a neural network, such as net = feedforwardnet(30);, which I trained [net tr] = train(net,p,t);
How can I plot this neural network? I would like something like:
(I'm especially interested in having the weights displayed on the graph)
Thanks, Franck

채택된 답변

Greg Heath
Greg Heath 2013년 1월 23일
The only NNTBX display that is available is
view(net)
However, perhaps you can find something online.
Hope this helps.
Thank you for accepting my answer.
Greg
  댓글 수: 1
Franck Dernoncourt
Franck Dernoncourt 2013년 1월 23일
Thanks for your answer, view() was indeed the only function I could find… But I'm surprised there is no existing code for such a common task. Maybe some function to output the network to a .dot file that we would give to GraphViz?

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

추가 답변 (3개)

Yashwant Kolluru
Yashwant Kolluru 2018년 7월 12일
[a,b] = train(net,x,t); y = net(x); e = gsubtract(t,y); %%%%%%%%%%%%%%%%%%% figure, plotperform(b); figure, plottrainstate(b); figure, ploterrhist(e); figure, plotregression(t,y);
hope it helps

fred  ssemwogerere
fred ssemwogerere 2020년 1월 2일
Hello, with the latest Matlab version 2019b, you are availed with a wide range of functions that can do this job for you. With my program for neural network modeling, i added some lines of code that also plot the best neural network. You can start by checking out the "line" and "viscircles" functions in the Matlab documentation. These can help you with what you want to plot. Below is a sample plot output from my code, of the best network i was designing. With added work, you can modify the lines to visualize the magnitude and direction of the weights, remove the axis bars, and many other things that you would like to do.
Regards,
Fred
neural.png
  댓글 수: 1
Maha Mosalam
Maha Mosalam 2021년 3월 1일
can you submit the line codes to do this, please

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


Sajjad Shawl
Sajjad Shawl 2022년 6월 5일
hi
have a look at this code from matlab exchange
quite usefull
Call the function to plot FNN: plotFNN(layersLength), where layersLength is a 1*n row vector containing the number of neurons in each layer.
https://www.mathworks.com/matlabcentral/fileexchange/87287-plot-feedforward-neural-networks), MATLAB Central File Exchange. Retrieved June 5, 2022.

카테고리

Help CenterFile Exchange에서 Sequence and Numeric Feature Data Workflows에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by