フィルターのクリア

Can I use weights and bias to manually verify the feedforwardnet?

1 回表示 (過去 30 日間)
Cheng Zhang
Cheng Zhang 2021 年 4 月 26 日
回答済み: Steven Lord 2021 年 4 月 26 日
I have 20 input and 20 target. I build feedforwardnet with one hidden layer of 10 neurons. I got "input weight (IW)" size of 10*20, "layer weight (LW)" size of 20*10. First bias size 10*1, second bias size 20*1.
I am trying to use Excel to manully calcuate the output step-by-step, so as to fully understand the procedure. What I do in Excel is (MMULT is the matrix multiplication function in Excel):
  • MMULT(20 input, IW) = 10 elements
  • 10 elements + First bias 10*1 = 10 elements
  • tanh(10 elements) = 10 elements
  • MMULT(10 elements, LW) = 20 elements
  • 20 elements + second bias 20*1 = 20 elements
I can do the calculation based on the above steps. However, the final results differ a lot from the MatLab's prediction. I can get the exact result by using Pytorch's weights and bias. Is "Tanh" the default activation function in feedforwardnet?

採用された回答

Steven Lord
Steven Lord 2021 年 4 月 26 日
Don't forget the pre- and post-processing steps.
net = feedforwardnet(10);
net.inputs{1}
ans =
Neural Network Input name: 'Input' feedbackOutput: [] processFcns: {'removeconstantrows', 'mapminmax'} processParams: {1x2 cell array of 2 params} processSettings: {1x2 cell array of 2 settings} processedRange: [] processedSize: 0 range: [] size: 0 userdata: (your custom info)
In this case that would be removeconstantrows and mapminmax. Also see the net.outputs property.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeQAM についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by