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.

4
  • only one hint - try to avoid for loops completely - use matrix/vector operations instead, that usually gives a huge performance boost Commented Jan 14, 2018 at 15:06
  • 1
    @MaxU: not necessarily any more: stackoverflow.com/a/48220174/7328782 Commented Jan 14, 2018 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. Commented Jan 14, 2018 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. Commented Jan 14, 2018 at 15:44

0

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.