Hi Hoda,
It is generally considered a good practice to pre and post process the data before and after its handled by the network. And that is what the NN toolbox does by default.
The available methods for pre processing inputs and post processing outputs can be access in a 2-layer network by typing:
net.inputs{1}.processFcns
net.outputs{2}.processFcns
So, you won't have to do anything at all. The network will receive your inputs and normalize them using mapminmax. Then the data will be processed by the network and then the outputs will be transformed back to your original units.
An example to make the math more clear:
load cancer_dataset;
mlp_net = newff(cancerInputs,cancerTargets,2,{'tansig'},'trainlm');
[mlp_net,tr] = train(mlp_net,cancerInputs,cancerTargets);
p = 10*rand(9,1);
y0 = sim(mlp_net,p);
p2 = mapminmax('apply',p,mlp_net.inputs{1}.processSettings{3});
y1 = purelin(mlp_net.lw{2,1}*tansig(mlp_net.iw{1,1}*p2+mlp_net.b{1,1})+mlp_net.b{2,1});
y2 = mapminmax('reverse',y1,mlp_net.outputs{2}.processSettings{2});
>> isequal(y0,y2)
ans =
1
Again, if you are using MATLAB R2011a, feedforwardnet is more efficient than newff. Just wanted to make sure that you can run the code no matter what version you have.
Best Answer