Why is the size of the input weight matrix sometimes smaller than the input length when training a neural network?

24 views (last 30 days)
I have a question regarding the size of the inut weight matrix for a neural network. My IW Matrix is smaller than expected and I don't know why. What I do:
net.IW %size of the input weight matrices
ans =
[1x14 double]
net.inputs.size %size of my inputs
ans =
net.layers.size %size of my hidden and output layer
ans =
As far as I understood, the size of my input weight matrix should be 1 (size of hidden layer) by 15 (length of input vectors). I tried it several times with different input sizes, but the size of IW sometimes is equal or 1-2 smaller than my input size.
I want to know why this happens and how I can match the weights to the input variables. Thanks in advance, Antje

Accepted Answer

Antje on 6 Sep 2012
Oh, finally I got it!
The problem was, that there were some redundant columns in the inputs. I have not seen them, because I have a huge amount of data.
It seems that the training process ignores these columns, but I could not see which of them.
If I get rid of them before the training, than there are no deviations in size of the input and size of the weight matrix.
Greg Heath
Greg Heath on 5 May 2017
You should.
They have zero variance.
Therefore they cannot contribute to learning.
However, they can confuse those who do not understand this.
Hope this helps.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!