How fitnet normalize/change the input?

조회 수: 3 (최근 30일)
Javier Guallart
Javier Guallart 2020년 12월 21일
답변: Shashank Gupta 2020년 12월 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