DIY AI: The Top Machine Learning Frameworks

Artificial intelligence (AI) has come a long way since Deep Blue beat chess grandmaster Garry Kasparov at his own game in 1997. Today’s AIs have moved on from chess to conquer other games such as Go and Shogi. They’re writing screenplays and dabbling in comedy, even assisting us directly in our homes and on our smartphones.

Fantastical tales of AI abound, but their biggest impact on our daily lives is less explicit. Machine learning algorithms have revolutionized the way businesses and organizations use big data. From Netflix predicting content for your next media binge to Amazon suggesting new products for your shopping cart, machine learning algorithms can process large volumes of unstructured data into valuable insights, predictions, decisions, and services.

Eager to build your own AI to better utilize data in your next project? In this post, we’ll look at the top machine learning frameworks.

What makes a good machine learning framework?

Before we dive into the list, let’s cover some basics. While there are plenty of tools and libraries available for creating machine learning algorithms, the comprehensive, low-level frameworks this list covers will let you build your own graphs from scratch.

  • Computational Graph: At its core, a machine learning algorithm is a mathematical function that takes in data at one end and outputs a solution at the other. A computational graph is simply a visual representation of that function. These graphs make it easier to understand how data flows through your algorithm.
  • Static vs. Dynamic Graphs: Machine learning frameworks can generally be divided into two main camps based on the type of computational graph they employ: static or dynamic. Frameworks that use static graphs, such as TensorFlow, encourage the creation of a fixed, reusable structure you can repeatedly execute by running data through the graph. This lets you treat static graphs as part of a programming language and makes it easier to distribute tasks across multiple machines.

Frameworks that use dynamic graphs, such as PyTorch, benefit from an implicitly defined computational graph that can change at runtime. Computation is flexible, more tightly coupled to the underlying programming language, and easier to debug. Dynamic graphs are great for designing complex neural networks.

1. TensorFlow

TensorFlow is Google’s flagship framework for building machine learning applications. It also happens to be the technology behind the impressive natural language processing (NLP) capabilities of Google Duplex demonstrated at Google’s I/O 2018. It uses a static graph with plenty of higher levels of abstraction available in the form of libraries such as the popular high-level neural network API Keras, Sonnet, and TFLearn. The primary language is Python, with secondary support for C++Java, and Go. There is also a C-based client API to help build support for other languages. TensorFlow currently benefits from the largest community, with many tutorials, documentation, and projects. The ability to visualize the fruits of your labor graphically in your browser with the TensorBoard is especially useful for newcomers to machine learning.

2. PyTorch

PyTorch is Facebook’s entry into the world of machine learning frameworks. PyTorch is in many ways a successor to Torch, an open-source machine learning library based on the Lua programming language that debuted in 2002. PyTorch differs in that it’s based on Python and can exploit major Python packages such as NumPy. Because PyTorch uses dynamic graphs, its machine learning algorithms are built with the normal Python programming control flow, making it easy to learn for Python developers. More important, using the standard Python control flow means it’s easier to whip up more-complex algorithms such as a tree-shape recurrent neural network (RNN) or rely on your favorite Python debugger. While PyTorch can’t use Keras, there are high-level APIs available such as Ignite and Scorch.

3. Microsoft Cognitive Toolkit (CNTK)

The Microsoft Cognitive Toolkit (formerly known as CNTK) is a static graph-based machine learning framework best known for its out-of-the-box support for multiple GPUs and CPUs and its computation speeds. It’s also known for its impressive image recognition capabilities. CNTK has its own built-in Python API but also supports Keras. The framework supports coding in Python, C++, C#, and its own model description language called BrainScript.

4. MXNet

Apache MXNet is one of the newer frameworks on this list; it specializes in creating deep learning neural networks and uses static graphs. Amazon Web Services selected MXNet as its official deep learning framework of choice. The framework is known for its scalability and high performance across multiple CPUs and GPUs. It also provides a dynamic programming interface for defining the model and algorithm without sacrificing training speed, with a higher level of abstraction available via Gluon.

5. Caffe2

Caffe2 is a lightweight and modular machine learning framework with a user-friendly Python interface geared toward mobile and large-scale deployments. The framework uses static graphs to provide an easy and straightforward way to train and deploy AI models, and it is currently actively supported by Facebook. The Caffe2 Model Zoo serves as the framework’s primary community hub where developers, researchers, and data scientists can share their work.

Selecting the right machine learning framework for your needs

This article barely scratches the surface of the libraries and tools out there that can help you build your own AI. Noteworthy absentees include machine learning pioneers such as Theano, which ceased development last year, Caffe, and Torch and contemporaries such as Deeplearning4j and Chainer. The purpose of this article is to provide an overview of the frameworks that have been trending. Consult an artificial intelligence engineer to help you choose the machine learning framework that best suits your workflow.