0

I'm creating some advanced machine learning algorithms in Matlab including neural network learning. This takes a lot of time because of number of iterations (ex. 3h for teaching network some pattern). Is there any way to estimate the computation cost without running the program? That would be an easy way to optimize algorythms without running them.

Manaslu
  • 228
  • 1
  • 13
  • only one hint - try to avoid `for loops` completely - use matrix/vector operations instead, that usually gives a huge performance boost – MaxU - stand with Ukraine Jan 14 '18 at 15:06
  • 1
    @MaxU: not necessarily any more: https://stackoverflow.com/a/48220174/7328782 – Cris Luengo Jan 14 '18 at 15:40
  • 3
    There is only one right way of optimizing: run the code under a profiler, spot the bottle necks, optimize those bits of code. Any other optimization that you do is premature. – Cris Luengo Jan 14 '18 at 15:42
  • 1
    Especially in a system like MATLAB it's very hard to predict what version of a bit of code will be faster, though there are some solid rules of thumb that you will gather as you gain experience. And unfortunately every new version of MATLAB can change the relative performance of code. – Cris Luengo Jan 14 '18 at 15:44

0 Answers0