Google captivated the world at I/O 2018 when its Google Assistant phoned in an appointment with a hair salon with all the pep and aplomb of a living, breathing human assistant. The tone was conversational, the prose complete with vocal fillers, and the rhythm so natural the recipients on the other end of the phone call were unaware they were speaking with a machine.

The technology behind this milestone in natural language processing (NLP) history? Google Duplex—a recurrent neural network built with TensorFlow Extended (TFX), Google’s internal end-to-end machine learning platform. TensorFlow is Google Brain’s open-source machine learning framework for the masses. Because Google plans to open-source more of TFX as time goes on, it’s no wonder TensorFlow is the most popular machine learning framework currently on the map. In this article, we’ll dive into the basics behind this powerful framework for building NLP apps, recommendation engines, image recognition software, and other applications powered by machine learning.

What Is Machine Learning?

To understand TensorFlow, one must first understand machine learning, a subset of artificial intelligence (AI) that combines statistical techniques with algorithms to help computers teach themselves. While traditional algorithms must take explicit instructions from human programmers to process any given data set, a machine learning algorithm builds an internal model based off a training data set in which all inputs are correctly matched with expected outputs. The more data you feed to the computer the more accurate the model becomes, allowing it to make predictions without human developers having to write additional lines of code. Once trained to the desired level of accuracy, the algorithm will be able to process large unstructured data sets that would be infeasible for a human programmer to attempt to map by hand.

What About Neural Networks?

The second piece of the puzzle you’ll need in order to understand TensorFlow is the challenge of creating an artificial neural network. In the AI field, neural networks are inspired by the human brain: Unstructured data goes into a network of interconnected neurons, and a learned output (such as the correct answer to a question on Jeopardy!) comes out. The creation of artificial neural networks like these falls under deep learning, a subset of the broader field of machine learning.

The neurons in an artificial neural network are actually functions called units arranged in a series of layers that take in data from one end and produce an output at the other. Like a brain, these units are interconnected with one another so that each layer refines its output based on what it received from the previous layer. The connections between units are represented by a weight, a number that tells the network how strong a given connection is. Those weighted values are the reason a mathematical model can “learn” through trial and error the difference between a cat and a dog in a database full of images. One can conceptualize a simple neural network with an input layer followed by any number of hidden layers before the desired response is produced in the output layer. The tricky part is the math behind mapping all the interactions between the neurons between layers.

What Is TensorFlow?

TensorFlow bills itself as an “open-source software library for high-performance numerical computation and machine learning.” TensorFlow allows data scientists to use Python to work with high-level abstractions of the data sets and complex mathematical expressions that make up a machine learning application. The actual math is handled at a lower level by high-performance C++ binaries. Put it all together and you have a collection of machine learning algorithms and other data science tools you can use to process large volumes of data. Let’s dive into the features and APIs that make up TensorFlow.

  • Tensors: A tensor is a multidimensional array, and the construct from which the framework itself gets its name. Tensor is the main data object you manipulate and perform operations on in TensorFlow.
  • Graphs: TensorFlow provides a graphical means of guiding the flow of data through a machine learning application with a dataflow graph. Dataflow is a programming model found in parallel computing, in which nodes represent computations and the connecting edges represent the tensors the operations are being performed on. tf.Graph basically serves as a place for your tensors and operations to live.
  • Eager Execution: For those who prefer the conventional Python control flow over the dataflow graph model, Eager Execution provides an imperative programming environment that lets you work with Python data structures. All the nitty-gritty details like the default dataflow graph behind every TensorFlow app are abstracted away.
  • Estimators: Estimators are high-level machine learning building blocks that greatly simplify the process of building a machine learning app. Training, evaluation, and prediction are all encapsulated into an API that can easily be exported for serving. There are premade estimators that are implementations of common machine learning models such as Linear Regression, K-Means, and Random Forest, ready to plug in and play, and custom estimators you can build yourself.
  • TensorBoard: TensorBoard is a data visualization tool that comes prepackaged with TensorFlow. It lets you see and manipulate tensors and operations on a whiteboard and see the flow of tensors throughout your application.

Pro tip: Looking for even higher levels of abstraction (read: more user friendly) to help you prototype and build your own machine learning applications? User-friendly deep learning libraries like Keras and TfLearn add plug-and-play modularity to your developer workflow.

What Can You Do with TensorFlow?

Machine learning is perfect for handling large-scale problems or unstructured data that would be impractical to code by hand using the classical, rule-based deterministic approach. From NLP to image sorting, self-learning algorithms are the natural choice. Looking for ideas on what you can accomplish with machine learning and TensorFlow? Check out these articles from our Hiring Headquarters:

Practically all the conveniences of modern living are powered by data, from virtual assistants such as the iPhone’s Siri to the recommendations on your Netflix feed. Businesses can use machine learning behind the scenes to better utilize the data they collect, whether it’s applying predictive maintenance to inform internal process improvements in manufacturing, boosting conversions through predictive analytics, or enhancing customer service through personalized customer journeys.