MATLAB: How to eliminate or ignore the weight matrix before layer one during training of a neural network

Deep Learning Toolboxiwmatrix

In the standard 3 layer net, there are 3 weight matrices: one before layer 1; one before layer 2; and one before layer 3. I would like to either eliminate the weight matrix before layer 1 (the IW matrix) or set it so that its weights are the identity matrix AND they will not be modified during training.

Best Answer

In order to change how the input weights are updated, you can set the "learn" property of the input weights:
net = newff([0 10],[5 1],{'tansig' 'purelin'});
net.inputWeights{1}.learn = 0;
For a more complete description of this, refer to Chapter 12's discussion of the Input Weights in the Neural Network Toolbox User's Guide.