0

I have a MATLAB code for neural network and it takes around 3 mins to train the network.(it trains around 85 files). When I use the profile viewer it says that trainlm has a self time 143.166s which 83.3% of that time comes from dWB = -(jj+ii*mu) \ je;

Is there a way of making it faster? Should I use data binning?

Thanks in advance!

2 Answers 2

1

That one line is a solution of a linear system of equations. The limit here is the number of unknowns, so the size of your network which defines the number of unknowns.

No, you cannot really reduce that time easily, unless you are willing to reduce the number of unknowns, or buy/find a faster computer.

Sign up to request clarification or add additional context in comments.

2 Comments

oh.. my supervisor told me that I can use Data binning but I really don't know what data binning actually does and if it will help me reduce the time.. thanks :)
Then maybe you need to talk to your supervisor?
0

Have you already checked whether you can somehow parallelize your code using parfor or the parallel computing toolbox in general?

9 Comments

well no.. I don't really know how do to that :/
Are you using for loops? If so, try you use parforloops. The following link could help you:mathworks.ch/ch/help/distcomp/parfor.html
I do..But it seems that it takes a long time not at the loop but when I have net = train(net,y,T');
It depends on how you bin your data. If bin it and then summarize for every bin, yes, you will lose some data. If you bin to use different cores on your computer, then you will not lose data. If you can somehow use parfor that would actual help, since every core would would run independently each loop. So your net=...would run on all cores in parallel.
btw avoiding forand while at all would also speed up your script. Functions like arrayfun etc are much more efficient...
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.