MATLAB: Neural Network Function identification

functionneural network

Description
I have 3 inputs and 12 outputs data. My programme need to be recognize the pattern from existing data, after that need to predict suitable outputs for new inputs. Every data have different range. Input (IP) 01 between 0.1 to 3, IP 02 between 1 to 8, IP 03 between 1 to 5, for first ten outputs (OP) between 0 to 0.25, 11th OP between 0 to 6, 12th OP between 0 to 0.15.
Question 01 The neural network start with random weights, the results also slightly differ everytime it is run. How can I control it to same outputs every time?
Question 02 I was in the mid of programming (attached below), what is the function prefer to use here to get the class indices?
>> x=Inputs; >> t=Targets; >> size(x)
ans =
3 100
>> size(t)
ans =
12 100
>> net=patternnet(20);
>> view(net)
>> [net,tr]=train(net,x,t);
>> plotperform(tr)
>> testX=x(:,tr.testInd);
>> testT=t(:,tr.testInd);
>> testY=net(testX);
>> testIndices=

Best Answer

To mitigate random initial weights in classifier design
1. Initialize the random number generator e.g., rng(0)
2. Design ~ 100 nets using a double loop over ~ 10 values of hidden nodes
j=0, h = Hmin:dH:Hmax, j=j+1 and ~ 10 random weight initializations
i = 1:Ntrials
3. For each design record
a. s(i,j) = rng % state of the rng
b. R2(i,j) and R2a(i,j)% Rsquared and degree-of-freedom adjusted Rsquared
c. Nerr(i,j) % Number of errors
4. Choose the net with the best combination of
a. Low validation error rate
b. Small number of hidden nodes
5. Details are in many of my posts. Search ANSWERS using (~17 hits)
patternnet Ntrials
Hope this helps.
Thank you for formally accepting my answer
Greg