How would I access the weights of a trained neural network?

I have a 2 layered neural network. I vary the No. of hidden(H) neuron form 1 to 10. Each network undergoes 10 trials(n). I calculate R2(n,H) and R2a(n,H). I would like to get the weight and bias values of the network that which has the smallest R2a. Is it possible? thanks in advance.

 채택된 답변

Greg Heath
Greg Heath 2014년 2월 12일
편집: Greg Heath 2014년 2월 12일
1. Before the double loop initialize your RNG (e.g., rng(0) ). From this you can deduce the state of the RNG before loop (nopt,Hopt). Therefore, you can recreate netopt.
2. However, this is much better:
a. initialize bestR2a = 0
b. whenever R2a > bestR2a, save n, H, and getwb(net)
c. You could save all of the n*H results or overwrite each previous choice and end up with only the final result.
3. Unless you are using dividetrain, the best net is usually chosen from the validation set performance and the best UNBIASED performance estimate on unseen data is obtained by the test set performance on the best net determined by the validation set.
4. I have noticed that many times in plots of R2 vs H for
a. Maximum R2a designs
b. Maximum R2val designs
that
(R2trn+R2trna)/2 ~ (R2val+R2tst)/2
However, I'm not sure what to do with that info.
Hope this helps.
Thank you for formally accepting my answer
Greg

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

질문:

2014년 2월 7일

편집:

2014년 2월 12일

Community Treasure Hunt

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

Start Hunting!

Translated by