MATLAB: Testing a neural network program

neural networktestingtraining

I have done a neural network program with matlab. I have trained the program with batch training mode. Now I want to test if the program work well. I know I can not change the weights in testing mode ie. the old weights under training mode in the network must be unchanged. I have trained the network with 26 different patterns simultaneously at every epoch and total 1014 patterns. Therefore, the weights in the network is initiated for 26 patterns. Now I want to test the network with just one patterns. How can I do this without changing the network weights.
Thanks in advance

Best Answer

[I Ntst] = size(ptst) % Test Input
[O Ntst] = size(ttst) % Target
% Naive constant model
y00tst = repmat(mean(tst,2),1,Ntst);
MSE00tst = mse(ttst-y00tst)
% Neural Net model
ytst = sim(net,ptst);
MSEtst = mse(ttst-ytst)
R2tst = 1- MSEtst/MSE00tst
Hope this helps.
Greg