How fitnet normalize/change the input?

7 ビュー (過去 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 Center および File ExchangeSequence 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