how i will get the predicted output from this neural network program?

also any corrections pls tell me,
% Target Vector T = [1 4 9 16 25 36 49 64 81 100]; % T=T';
% Input Vector p =[1 2 3 4 5 6 7 8 9 10]; % p = p';
% Number of hidden neurons S1 = 20;
% Create Network net = newelm(p,T,S1);
% Train Network pseq = con2seq(p); Tseq = con2seq(T); net = train(net,pseq,Tseq);
% Test the network Y = sim(net,pseq); z = seq2con(Y); diff1 = T - z{1,1};

 Accepted Answer

Part of a longer answer isanswer is:
1. The plotted I/O relation is simple and can, for interpolation, be modelled, WITHOUT feedback (e.g. newfit (newff) or fitnet (feedforwardnet), with a SMALL number of hidden nodes, H.
2. However, for future value prediction, feedback from hidden (newelm) and or output (narxnet) nodes is desired.
3. The ranges of P and T are large enough to seriously consider standardization (e.g., zscore or mapstd)
4. More data is needed to yield sufficiently large training, validation and test subsets in order to convincingly illustrate either interpolation (e.g., trn/val/tst are intermingled) or prediction (trn precedes val and tst).
5. If the number of estimated weights, Nw, exceeds the number of training equations, Neq, the net is OVERFIT and OVERTRAINING MITIGATION MEASURES , e.g.,
a. Reduce H and minimize the degree-of-freedom-adjusted training MSE :
MSEtrna = SSEtrn/(Neq-Nw) with the stopping goal MSEtrna <= 0.01*var(Ttrn).
b. Validation set stopping
c. Regularization via msereg
should be employed to prevent poor performance on nontraining data.
6. A more interesting problem than the current one is to try to design a net that will predict nontraining outputs with MSEtst <= 0.01*var(Ttst) using P = [Ptrn,Pval,Ptst] = 0:100; T = P.^2;
Greg

More Answers (1)

The short answer is
MSE00 = var(T,1,2) % 1051.1 MSE of the naive Y = mean(T) model
Z = cell2mat(Y) % seq2con(Y) is a cell
MSE = mse(T-Z) % 10.02 Mean-Square-Error
NMSE = MSE/MSE00 % 0.00953 Normalized Mean-Square-Error
Rsquare = 1 - NMSE % 0.99047 Coefficient of Determination (See Wikipedia)
Thank you for formally accepting my short answer
Greg

Categories

Find more on Deep Learning Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!