How fitnet normalize/change the input?

8 次查看(过去 30 天)
I'm trying to create a neural network that fits my data. I have my input and target data and the net achieves to fit it. But, as I wants to export the matrices (weights and bias) to another different environment, I want to know what operations the net is using to go from the input to the output when I evaluate an input.
X = importdata('INPUT.txt', ',', 0);
target = importdata('OUTPUT.txt', ',', 0);
net = fitnet(20);
net.layers{1}.transferFcn = 'poslin';
[net,tr] = train(net, X, target);
w1 = net.IW{1};
w2 = net.LW{2};
b1 = net.b{1};
b2 = net.b{2};
ej = X(:,1);
sol1 = w2*poslin(w1*ej+b1)+b2;
sol2 = net(ej);
See the last two lines. Why those values are not the same?

回答(1 个)

Shashank Gupta
Shashank Gupta 2020-12-30
Hi Javier,
Yes your intution is correct. fitnet have some preprocessing and postprocessing involved. These processing functions are captured in the layer properties of the network.
For example, You can see the preprocessing of input by accessing Input layer, Giving a code snapshot for you to try.
% Process function
net.inputs{1}.processFcns
% Process function parameters.
net.inputs{1}.processParams{1}
and the same way you can access processing function for every layer(also output layer).
Try doing it, you will be able to get the correct answer.
Cheers.

类别

Help CenterFile Exchange 中查找有关 Sequence and Numeric Feature Data Workflows 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by