# Understand number of weights of Neural Network

조회 수: 4 (최근 30일)
Joel 2018년 1월 24일
답변: Greg Heath 2019년 8월 23일
I have a Mx120 validation dataset (A), and a Nx120 training dataset (B).
The results look promising, but I am struggling to understand how the weights relate to the training dataset.
using the following code
net = fitnet([]);
% Setup Division of Data for Training, Validation, Testing
net.divideFcn = 'dividerand'; % Divide data randomly
net.divideMode = 'sample'; % Divide up every sample
net.divideParam.trainRatio = 70/100;
net.divideParam.valRatio = 15/100;
net.divideParam.testRatio = 15/100;
% Train the Network
[net, tr] = train(net, B, A);
And the following line to inspect the weights
% View the weights
net.IW{1,1}
I see that the number of weights are N-1 - i.e. the number of variables in the training dataset minus one.
What I would like to be able to do is to understand the relative importance of each of the variables in the training dataset. Is this possible?
Apologies if this has been asked before. I did not manage to find a matching answer, but may very well have missed something. If so, please do point me in the right direction.
Thank you in anticipation.

댓글을 달려면 로그인하십시오.

### 채택된 답변

Greg Heath 2018년 1월 25일
편집: Greg Heath 2018년 1월 25일
You are THOROUGHLY CONFUSED!
You do not understand MANY fundamental concepts.
1. [ trainednet, trainingrecord] = train(untrainednet, input, target)
where
target = desiredoutput
2. output = trainednet(input);
3. error = target - output;
4. input, target, output and error with length N are all divided into 3 INTERMINGLED parts: TRAINING, VALIDATION AND TESTING with number of points Ntrn, Nval and Ntst ,respectively with
N = Ntrn + Nval + Ntst
5. a. trn used to calculate weights
b. val used to stop training when val error
CONTINUALLY INCREASES FOR A SPECIFIED NUMBER
OF EPOCHS (eg, 5)
c. tst used to obtain an unbiased
(i.e., nondesign) error estimate
Hope this helps.
Thank you for formally accepting my answer
Greg
##### 댓글 수: 1이전 댓글 -1개 표시이전 댓글 -1개 숨기기
Joel 2018년 1월 26일
Thanks for the thorough explanation, Greg. I appreciate it! I clearly need to read up more about especially point 4.
Thanks again.

댓글을 달려면 로그인하십시오.

### 추가 답변 (2개)

Ali sameer 2019년 8월 17일
편집: Ali sameer 2019년 8월 18일
Dear sir ;
the first step in ANN in matlab toolbox is to sellect the weights and baises ranomly then it is going to correct these values.
Is it possible to manually enter the initial values to ANN rather than it automatically selects these values randomly and then train the ANN based on selected weights and baises
thanks
##### 댓글 수: 0이전 댓글 -2개 표시이전 댓글 -2개 숨기기

댓글을 달려면 로그인하십시오.

Greg Heath 2019년 8월 23일
It is possible.
In general, however, you don't have the slightest idea what choice would be significantly better than random.
Moreover, the number of successful random initializations is, typically, infinite.
Furthermore, it is much easier to train 10 randomly initialized nets ON TRAINING DATA and choose the one with the BEST VALIDATION PERFORMANCE in order to get an UNBIASED ESTIMATE of the best performing net on unseen (e.g., TEST) data.
Hope this helps.
*THANK YOU for formally accepting my answer!
GREG

댓글을 달려면 로그인하십시오.

### 카테고리

Help CenterFile Exchange에서 Gaussian Process Regression에 대해 자세히 알아보기

### Community Treasure Hunt

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

Start Hunting!

Translated by