Hello,
I want to save the workspace at each iteration (in a vector maybe). By doing this, I will be able to reach any workspace generated at any iteration.
Thank you.

댓글 수: 3

Geoff Hayes
Geoff Hayes 2014년 11월 17일
Ibra - when you say that you want to save the workspace at each iteration do you mean that you want to save a particular variable or all variables at that iteration (like a snapshot)? Please provide more details concerning the variables. Depending upon how many there are, you may want to save all to a file or save all to a structure (which gets saved to an array/vector).
ibra
ibra 2014년 11월 18일
Hello Geoff,
To be more specific, I'm training a Neural Network. I want to train it for several times within a for loop and find out which network structure gives the lowest error. Therefore, I can say that I want to save the whole variables in the workspace at each iteration.
Thank you.
Image Analyst
Image Analyst 2014년 11월 18일
Just have the variables be arrays. Assign the value to an array with the same index as the loop index (if it's sequential integers).

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

 채택된 답변

Greg Heath
Greg Heath 2014년 11월 18일

2 개 추천

Typically I design 100 nets at a time using a double loop: 10 values of hidden nodes: h = Hmin:dH:Hmax and 10 random initial weight assignments ntrial = 1:Ntrials for each value of h.
Instead of saving all of the nets, just save h, the state of the random number generator s(rng) and the corresponding performance measure (NMSE or Rsquared = 1-NMSE) for each design. Afterwards the values of h and s for the smallest NMSE are retrieved and the best net can be retrained.
Better yet, alternatively start with the first net as the best net. Then each time a new design is better, that becomes the best net. Consequently, only one net needs to be saved at any time.
If you wish, you could modify the last approach to save the best 10 (or whatever) nets.
I have posted many, many designs using the first approach. Unfortunately, I have posted at most, a few designs using the best saved net.
I will search for the latter and post the URLs.
The first approach designs are reasdily found by searching
greg i=1:Ntrials h=Hmin:dH:Hmax (or h = 0:dH:Hmax)
Hope this helps.
Thank you for formally accepting my answer
Greg

댓글 수: 1

Greg Heath
Greg Heath 2014년 11월 18일
NN accuracy on test set low Asked by Anitha on 12 Mar 2014 http://www.mathworks.com/matlabcentral/answers/121234-nn-accuracy-on-test-set-low =============================================================================
Subject: DUPLICATING THE BEST NEURAL NET DESIGN From: Greg Heath Date: 18 Mar, 2014 http://www.mathworks.com/matlabcentral/newsreader/view_thread/334932#919949

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Matrix Indexing에 대해 자세히 알아보기

질문:

2014년 11월 17일

댓글:

2014년 11월 18일

Community Treasure Hunt

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

Start Hunting!

Translated by