How to stop changing weights in neural network?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Ayesa
el 22 de Feb. de 2012
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.
0 comentarios
Respuesta aceptada
Greg Heath
el 22 de Feb. de 2012
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
Más respuestas (0)
Ver también
Categorías
Más información sobre Sequence and Numeric Feature Data Workflows en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!