In-depth analysis of why deep learning is done with python instead of java or c++

Old programmer's favorite hobby 2022-11-24 20:27:31 阅读数:368



  1. Python is an interpreted language, which makes writing programs more convenient.For example, to write a matrix multiplication in a compiled language such as C, you need to allocate operands (matrixes), allocate memory for the result, manually call gemm to the BLAS interface, and finally reclaim the memory space manually if the smart pointer is not used.Python is almost a matter of import numpy; two sentences.Update (2015-5-7): Of course, many C/C++-oriented libraries now support managed memory management, which makes the development process much easier, but interpreted languages ​​still have inherent advantages—no compilation time required.This is very beneficial to the work efficiency of machine learning, a research direction that requires a lot of prototyping and iteration.(Benefits for readers at the end of the article)

  2. Python's development ecosystem is mature, and there are many very useful libraries available.In addition to NumPy mentioned above, there are also SciPy, NLTK, os (built-in) and so on.Python's flexible syntax also makes it very easy and efficient to implement very practical functions including text manipulation and list/dict comprehension (high writing and running efficiency), and it is even more convenient to use with lambda.This is also one of the reasons behind Python's benign ecology.In contrast, although Lua is also an interpreted language, even with the blessing of an artifact such as LuaJIT, it is difficult for itself to be like Python. One is because the predecessor of Python occupies the market share, and the other is because of its various abnormal common (such as global variables).However, with the help of Lua-Python bridge and Torch, Lua seems to be rising parasiticly.

  3. Easy to write programs is very important for people doing machine learning.Because it is often necessary to make various modifications to , this is likely to be a matter of affecting the whole body in a compiled language, and it can usually be implemented in very little time in Python.

  4. Python's efficiency is not bad.The development of interpreted languages ​​has far exceeded the imagination of many people.Many syntactic sugars such as list comprehension are implemented close to the kernel.In addition to JIT[1], there are other methods that can greatly increase operating efficiency.Finally, thanks to the Python-to-C interface, many efficient and Python-friendly libraries like gnumpy and theano can speed up the running of the program. With the support of a strong team, these libraries may be more efficient than an unskilled programmer.The efficiency of C writing and tuning for one month is even higher.

Reader benefits: Knowing that you are interested in Python, I have prepared this set of python learning materials,

For beginners with 0 basics:

If you are a zero-based novice, you can consider getting started with Python quickly.

On the one hand, the learning time is relatively short, and the learning content is more comprehensive and concentrated.
The second aspect is that you can find a learning plan that suits you

Including: Python web development, Python crawler, Python data analysis, artificial intelligence, machine learning and other tutorials.Take you to learn Python systematically from zero foundation!

Introduction to zero-based Python learning resources

Python learning route summary

The technical points in all directions of Python are sorted out to form a summary of knowledge points in various fields. Its usefulness lies in that you can find corresponding learning resources according to the above knowledge points to ensure that you can learn more comprehensively.(Collect at the end of the tutorial)

Python essential development tools

Reminder: The space is limited, the folder has been packaged, and the way to obtain it is at the end of the article

Python Learning Video 600 Collection

Watching zero-based learning videos is the fastest and most effective way to learn. Following the teacher's ideas in the video, it is easy to get started from the basics to the in-depth.

Actual case

Optical theory is useless, you have to learn to follow along, and you have to do it yourself to apply what you have learned to practice. At this time, you can learn from some actual combat cases.

100 Python practice questions

Check the learning results.

Interview questions

insert image description here

Receipt of materials

This complete set of learning materials for Python has been prepared for everyone. If you need it, you can scan the QR code below to add it on WeChat. Enter "receive materials" to receive a full set of materials for free【If you need any cooperation, you can contact me at any time] Moments will also update the most preface python knowledge from time to time.
insert image description here

Good article recommendation

Understand the prospect of python:

Understand python's sideline:

copyright:author[Old programmer's favorite hobby],Please bring the original link to reprint, thank you.