How can I access the weights and connections in nftool in MATLAB?

조회 수: 11 (최근 30일)
Hi. I want to create a neural network for a fitting problem and assign the connections between neurons by myself. I also would like to access the weights and see how they change with each epoch. Is there any way to do this ?

채택된 답변

Greg Heath
Greg Heath 2015년 4월 3일
I don't understand: The weights are the connections between neurons.
Also, I do not understand why you would want to do this. In general, knowing the weight values doesn't help much because there are a huge number of weight combinations that will minimize the error.
What are the sizes of your input and target matrices?
However, it should help quite a bit if you
1. Transform inputs to be uncorrelated, zero-mean and unit variance (zscore or mapstd).
2. Similarly for outputs.
3. Minimize the number of hidden nodes subject to a maximum error constraint (e.g., MSEgoal =
0.01 (or 0.005) * mean(var(target',1))
4. NOTE: Given the output transformation in 2, mean(var(target',1)) = 1
Access:
IW = net.IW ; B = net.b ; LW = net.LW;
Modification:
net.IW = IWnew; net.b = Bnew; net.LW = LWnew
To modify connections see the doc and website documentation.
Hope this helps
Thank you for formally accepting my answer
Greg
  댓글 수: 2
Ananthakrishnan Rajendran
Ananthakrishnan Rajendran 2015년 4월 5일
I am trying to build a neural network on hardware. So I have access to only a limited rage of weights. I want to compare my results with a software implementation. I know the weights are huge and don't make sense usually. But I would like to set an upper and lower bound to the weights so that I can compare the results I get and make sense of it.
If you think there is no way to actually control the weights, then I guess there is no point in me pursuing implementing a neural net using MATLAB.
Ananthakrishnan Rajendran
Ananthakrishnan Rajendran 2015년 4월 5일
Also, I'm trying a simple 3 bit parity problem. It basically has 3 inputs and one output. The total data that I have at my disposal is only 8 input combinations. This is a very simple problem, but this will be my baseline for the remaining work.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Greg Heath
Greg Heath 2015년 3월 30일
I think you will have to use the command line approach and loop over 1 epoch at a time.
It will be painfully slow even if you modify train or adapt.
Hope this helps.
Thank you for formally accepting my answer
Greg
  댓글 수: 1
Ananthakrishnan Rajendran
Ananthakrishnan Rajendran 2015년 4월 2일
Hi Greg!
Thanks for responding. Do you know how I'll be able to access and modify the weights in the neural network if I decide to use the toolbox? I need to modify the connections between neurons as well.

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

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

Start Hunting!

Translated by