The origin of artificial intelligence and Python is the same as when we count data or choose to use excel to make tables, because when we need to add, subtract, multiply, divide or function, we only need to apply the company. Because functions such as SUM and AVERAGE are run in languages such as C++/C#, Excel is just a tool, a presentation form, not a calculation. Similarly, when learning artificial intelligence, Python is just a tool to operate the deep learning framework. The main modules actually responsible for the operation do not depend on Python, but many complex C++/CUDA programs do work.
When studying artificial intelligence deeply, it is too complicated to calculate and write C++ code operations by yourself. At this time, the programmer wants to build a neural network, without a set of complicated Excel configuration tables, directly fill in the parameters and import the data, and start training the model with one click to get the results. This method is simple and practical, but the construction of neural network is too complicated, and there are too many parameters to fill in, so it is difficult to make various options into intuitive graphical tools. We can only use a relatively easy-to-use Python-like language to build a neural network through simplified program code, fill in parameters, import data, and call execution functions for training. This language is used to describe models, pass parameters, transform input data, and then throw them into a complex deep learning framework for calculation. So why Python?
Scientists have long liked to use Python experimental algorithms, and they are also good at using numpy to do scientific calculations and using pyplot to draw data maps. Python is also widely used in Google, so it is inevitable to adopt Python. In addition to Python, TensorFlow framework actually supports JavaScript, c++, Java, GO and other languages. It is said that artificial intelligence algorithms can also use these. But officials say that languages other than Python do not necessarily promise the stability of the API. So artificial intelligence and Python are inseparable.
That is to say, the core algorithm of artificial intelligence depends entirely on C/C++, because it requires a large amount of calculation, very fine optimization, and interfaces such as GPU and special hardware, which only C/C++ can do. So in a sense, C/C++ is actually the most important language in the field of artificial intelligence. Python is the API binding for these libraries. To develop a cross-language interface from other languages to C/C++, Python is the simplest, which is much lower than the ffi threshold of other languages. CPython's C API is bidirectional, which can directly expose encapsulated Python objects, allow users to introduce new features by inheriting these custom objects, and even call Python functions from C code.
Python has always been an important tool for scientific calculation and data analysis. Python is the API binding of these libraries, and it is necessary to develop a cross-language interface from other languages to C/C++. Python is the simplest, and the ffi threshold of other languages is much lower. CPython's C API is a two-way fusion. You can directly expose encapsulated Python objects, allow users to introduce new functions by inheriting these custom objects, and even call Python functions from C code. It is said that the times make heroes, and it can also be said that artificial intelligence and Python achieve each other. Artificial intelligence algorithm promotes the development of Python, and Python also makes the algorithm simpler.