If by "I have already build my neural network" you imply that
1. The network architecture is defined and has to be trained:
Then you can access the layer weights as follows:
You can set any values to the above weights and set the net.layerWeights{i,j}.learn to 0 so that the weights won't be altered during the training & adaption. In this case setting a specific weight for a connection is not possible since the property net.layerWeights{i,j}.learn is defined for the entire connections between layers i and j.
net.layerWeights{i,j}.learn = 0
net.LW{i,j} = ones(size(net.LW{i,j}))
2. The network architecture is defined and trained already:
Then you can set weight of a connection between nodes k & l of layers i & j as follows:
and then use the network.
The above things can be done to Input wieghts too.
1 Comment
Direct link to this comment
https://uk.mathworks.com/matlabcentral/answers/499607-set-a-specific-weight-for-a-connection-in-neural-networks#comment_784544
Direct link to this comment
https://uk.mathworks.com/matlabcentral/answers/499607-set-a-specific-weight-for-a-connection-in-neural-networks#comment_784544
Sign in to comment.