How to train NN by keeping all the weights fixed except one of the weights ?

3 views (last 30 days)
I am using the neural network toolbox for my project,and I need to make big neural network which all its weights are fixed(I need to set specific weight to them before training) except of one weight(which need to be obtained after this training), How can I train my net which wants to update just one weight and keeps other weights unchanged?
although I read the below link but still I confused with my problem:
I will appreciate in advanced if anyone can help me with this problem.

Accepted Answer

Greg Heath
Greg Heath on 27 Oct 2014
You would have to write your own code to have separate learning rates for different subsets of weights.
In lieu of that you could train or adapt the net one epoch at a time. After each epoch, replace the weights that you want to keep constant. My experience shows that you may also have to reinitialize mu if you use trainlm. If you use another training or adaptation algorithm you should check to see what internal parameters are reinitialized upon recall of the algorithm.
I performed a very quick and dirty test with simplefit_dataset, fitnet, train and trainlm. When the weight to be trained is the smallest of the weights the technique was successful; when it was the largest, it was not. Many more test examples would have to be run before the technique can be graded.

More Answers (0)

Categories

Find more on Sequence and Numeric Feature Data Workflows in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!