Generating a graph from neural network

조회 수: 4 (최근 30일)
Reff
Reff 2020년 4월 19일
댓글: Ameer Hamza 2020년 4월 19일
Hi. How to generate a graph from neural network train tool?
Let say for y-axis = MSE and Accuracy, x-axis = number of neuron.
Thanks in advance.

채택된 답변

Ameer Hamza
Ameer Hamza 2020년 4월 19일
I think if you want to use neural network train tool, then you will need to configure each network separately and save their accuracy and MSE values. It will be easier if you write the code to train your network and then use a for-loop to try different numbers of neurons. Following code shows an example
[x,t] = simplefit_dataset;
N = [1 2 3 5 10 20]; % number of neurons to try
MSE = zeros(size(N));
for i=1:numel(N)
net = feedforwardnet(N(i));
net = train(net, x, t);
y = net(x);
MSE(i) = perform(net,y,t);
end
plot(N, MSE);
xlabel('Neurons');
ylabel('MSE');
  댓글 수: 4
Reff
Reff 2020년 4월 19일
error line at [a',b'] = simplefit_dataset;
dimension matrix a & b are
a: 9x60
b:9x1
Ameer Hamza
Ameer Hamza 2020년 4월 19일
Reff, I added this line
[a',b'] = simplefit_dataset;
to load an example dataset. If you already have variables a and b then try to run this code after removing this line.

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

추가 답변 (0개)

카테고리

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