Am I better off using Python packages than coding my own stuff in C++? (MACHINE + DEEP learning) For Machine and Deep Learning purposes, is it recommended to simply use Python and the packages available for it, rather than coding it manually in C++?
I wished to do so for performance gains, but I am hearing that the Python packages are so well-optimized that they perform better than anything I could write in a short time in C++?
 A: There's at least three considerations here:


*

*effort: unless what you do is extremely time consuming and computationally expensive, the effort to try to come up with a better implementation is usually not worth it, even if it is possible (i.e. you save some seconds, but spend days implementing)



*flexibility (closely related to effort): major libraries tend to have a lot of options implemented, so you can switch/change/experiment and do a lot of obvious things really easily without having to code anything extra

*futility: major libraries tend to be extremely well optimized and often may use some for of C or numba or some other mechanism to achieve fast computation in the background - e.g. fast execution may not help you, if you are not aware of various clever computational tricks (e.g. how to parameterize something, some numerical tricks like log_sum_exp etc.). 



My default assumption is that it is usually not worth it.
When would I consider it: 


*

*You would just have to program everything from scratch in python
anyway.

*If you want to do something very non-standard for which there is only some really mediocre implementation

*You need some really specific narrow thing that is being slowed down by unnecessary overhead in the major library.

*What you will implement will compute away for many, many months or years (think SETI at home) and investing in a streamlined focussed implementation makes some weeks of programming time well
worth it.

