How to stop changing weights in neural network?

2 ビュー (過去 30 日間)
Ayesa
Ayesa 2012 年 2 月 22 日
編集済み: Jamie 2013 年 10 月 21 日
I have assigned the input weights and layer weights to NN and i want that these weights should be fixed through out the whole training process. 'trainlm' is used which calls 'calcperf2.m' function.
But while training the NN, i found that the weights are changing. (I found it from line no. 134 and 151 in 'calcperf2.m' file).
How can be this weight changing stopped? I want the weights should not be changed and it should be same as assigned weights.
Following is my NN code:
input = [0 0 1 1; 0 1 0 1];
target = [0 1 1 0];
net = newff(input,target,[2],{'tansig','tansig'},'mytrainlm');
net.IW{1,1} = [ 3.1984 -3.1330; -2.6130 2.6804];
net.LW{2,1} = [ 7.3493 7.5012];
[net tr Y E] = train(net,input,target)
outputs = sim(net,input)
Please help me. Thanks.

採用された回答

Greg Heath
Greg Heath 2012 年 2 月 22 日
The whole purpose of training is to change weights from assigned inital values to final values that correspond to the minimum of an objective function.
If you don't want the initial weights to change, do not use train.
Hope this helps.
Greg
  1 件のコメント
Ayesa
Ayesa 2012 年 2 月 23 日
Thanks for your help. You are right.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSequence and Numeric Feature Data Workflows についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by