How to resolve out of memory error?

2 vues (au cours des 30 derniers jours)
Minnu
Minnu le 25 Avr 2013
I've a problem that occurs when I train the neural network using the code
net = train(net,x,t);
I have got the error "Out of memory. Type HELP MEMORY for your options." Do anybody have idea how to solve this kind of problems?
Thanks
  2 commentaires
Greg Heath
Greg Heath le 27 Avr 2013
size(x), size(t), No.of hidden nodes, sample code,...?
Minnu
Minnu le 29 Avr 2013
size(x) is- 830x27
size(t) is- 12x27
no of hidden nodes:20

Connectez-vous pour commenter.

Réponse acceptée

Greg Heath
Greg Heath le 1 Mai 2013
Unfortunately, your problem is not well posed.
You have 27 I/O pairs. The 27 inputs define, at most, a 26-dim subspace. However, you have 830 "components". You need to transform to a smaller space with at most 26 dimensions.
The simplest way is to use a principal components transformation. You can do this separately or use the PROCESSPCA input processing option of fitnet (regression) or patternnet (classification).
The number of equations that you have is
Neq = prod(size(t)) = 12*17 = 204
With H hidden nodes, the number of unknowns(weights) to estimate are
Nw = (I+1)*H+(H+1)*O
where { I N ] = size(x) and [O N ] = size(t)
If you reduce I to 26,
Nw = O + (I+O+1)*H = 12+39*H
and if you wish to have more equations than unknowns,
H <= Hub = -1 + ceil( Neq-O)/(I+O+1) ) = 4
In addition, if you replace 26 with 830, you see the problem.
Fortunately, there are ways to obtain stable, accurate solutions using a variety of methods. The NNTBX offers validation stopping and objective function regularization. However, with only 27 cases, I don't think you should use any for validation. Therefore,
1. Reduce your input dimensions below 27
help/doc processpca
2. Use the regularization training function 'trainbr'.
help/doc trainbr
3. Search for the minimum H that gives you satisfactory results. 10 different weight initialization trials for each value of H = 1:10 may be sufficient.
4. Once you have determined Hopt, you can obtained less biased performance estimates on nontraining data by using 10 repetitions of 9-fold cross-validation with 24 training cases and 3 testing cases. Although there are 27*26*25 = 17,550 ways that you can choose the 3-member test set, it is hard to believe that 10 repetitions of 9-fold cross-validation won't be more than sufficient.
Hope this helps.
Thank you for formally accepting my answer
Greg

Plus de réponses (1)

Jan
Jan le 25 Avr 2013
As you will find as answer for dozens or euiqvalent questions in this forum, when you search for them:
  • Install more RAM
  • Close other applications
  • Install even more RAM
  • clear variables, which are not used anymore
  • Use a 64 bit version of OS and Matlab, such that it is useful to:
  • Install much more RAM
  • Increase the virtual memory, when it does not matter if the program need 100 times longer.
  2 commentaires
Minnu
Minnu le 29 Avr 2013
When i run my code on laptop ,pc same error occurs .how to resolve it
Jan
Jan le 29 Avr 2013
@Minnu: If I wasn't clear enought already:
Installing more RAM solves the problem, that the installed RAM is exhausted.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Introduction to Installation and Licensing dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by