What exactly does input/output range parameter do in ANN structure?

11 views (last 30 days)
I've notice that in Matlab, ANN is defined not only by wight and biases but also by a two additional parameters, which is quite uncommon in overall ANN concept. Look at my example, let's say that I have 2 layers feedforward ANN (1 hidden layer, 1 output), it takes 3 parameters, and gives 1 as the output:
net_article=feedforwardnet(10);
net_article.inputs{1}.size=3;
%net_article.inputs{1}.range=[0 100;0 100;0 100];
%net_article.output.range=[1 200;];
net_article.layers{2}.size=1;
L1=[-1.1014, -2.1138, -2.6975;
-2.3545, 0.7693, 1.7621;
-1.1258, -1.4171, -3.1113;
-0.7845, -3.7105, 0.1605;
0.3993, 0.7042, 3.5076;
0.283, -3.914, -1.3428;
-2.0566, -3.4762, 1.3239;
-1.0626, 0.3662, 2.9169;
0.1367, 2.5801, 2.5867;
0.7155, 2.6237, 2.5376;];
B1=[3.5997, 3.1386, 2.7002, 1.8243, -1.9267, -1.6754, 0.8252, 1.0865, -0.0005, 0.6126];
L2=[0.5005, -1.0932, 0.34, -1.5099, 0.5896, 0.5881, 0.4769, 0.6728, -0.9407, -1.0296];
B2=0.1567;
net_article.IW{1}=L1;
net_article.Lw{2,1}=L2;
net_article.b{1}=B1';
net_article.b{2}=B2;
output=net_article([40; 30; 20])
The output will be 0.1464. Now please uncomment line 3 and 4 to apply these enigmatic ranges. The result of the very same ANN, with exactly the same weights and biases is now 119.1379.
So my question is what exactly this "range" does? How it is implemented in the case of equations? Does it mean that all the scientific articles that provided only weights and biases are usless if you want to reproduce the ANN in Matlab?

Answers (1)

Walter Roberson
Walter Roberson on 31 Jul 2022
The input is declared to fall in the range 0 to 100. The data is shifted and rescaled to be in the range 1 to 200
scaled_data = (data - 0)/(100-0) * (200-1) + 1
  2 Comments
Karol P.
Karol P. on 1 Aug 2022
Edited: Karol P. on 1 Aug 2022
Ok, I think I understand. But two things are not fully clear.
1.The range 0 to 100 is declared in ANN, but how to determine the 1 to 200 range? Let's say I type input=50. I definitely miss something.
2. Where this function is applied? In the case of output range I can imagine that it can be connected with transfer function of output layer (Am I correct?). But how it works for input?
Karol P.
Karol P. on 9 Aug 2022
After testing you solution I think it is not correct. The result of
scaled_data = (data - 0)/(100-0) * (200-1) + 1
Is 1.2913, so still not the desired output.

Sign in to comment.

Products


Release

R2022a

Community Treasure Hunt

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

Start Hunting!