Python and AI (Part 1)

Python and AI (Part 1)

Behind all the hype of self-driving cars, the automation of jobs and smart robots is sophisticated software teamed with powerful hardware. In this first post of a two-part series, we’ll see why the same features which have propelled Python’s popularity in other niches allows Python to also feature prominently in artificial intelligence (AI).

What is AI?

AI actually encompasses many inter-related technologies and fields of research. The common thread tying them all together is the goal enabling computers to both process information and then make decisions like humans do. Here’s a partial list:

Machine Learning algorithms which form and update a computer’s internal model of something, much  like we do as we learn about the world around us. One common type of machine learning algorithm is supervised machine learning algorithms, which learn to classify things by first being shown many examples of items which have already been classified.

Another machine learning approach, unsupervised machine learning, is what enabled Google X’s neural network to develop its own concept of cats (and recognize pictures of them with high accuracy) by viewing images from YouTube videos.

Natural Language Processing (NLP) makes voice recognition possible, like voice queries to Apple’s Siri or Amazon’s Alexa. NLP takes text strings or digitized voice data and parses out the subject, object, modifiers, prepositions, etc . . . and determines the relationship between them in order to provide you with the information you are requesting.

Computer vision includes algorithms for edge detection (useful for object recognition) and object counting. Machine vision is already used for automated visual inspection in factories. The human brain heavily pre-processes everything we see before we’re even aware it. You can think of optical illusions as artifacts from this processing. Computer vision attempts to bring that same level of sophistication and speed to software.

What Does AI Need from a Programming Language?

Modern AI software works with a lot of data, often in the form of matrices and multidimensional arrays. Other requirements are advanced statistics, matrix operations and other advanced math operations. For responsiveness, both speed and scalability are required, since the computational workload may be spread over several computers to handle the large amount of data. Stability is a must too: would you want your self-driving car to blast through a windy road at 150kph due to a double free() error? That would give the term “race condition” a whole new meaning. . .

Other requirements are less technical. Any programming language used for AI must be easy to use and learn for developers, since AI is rapidly being incorporated into all types of software platforms. The language must also be actively maintained: not only to fix bugs, but also to incorporate new algorithms and advances in AI research.

The Python Advantage

Readers of our blog already know that Python meets the criteria of speed, scalability, stability, ease of learning, ease of use and active development. But what about the support for matrix operations, advanced statistics and other high-level math operations?

In our next post, we’ll see how Python’s extensive ecosystem meets that challenge too and how Python is driving much of the AI revolution.

Copyright © Python People