Developer(s) | Google Brain Team [1] |
---|---|
Initial release | November 9, 2015 |
Repository | github |
Written in | Python, C++, CUDA |
Platform | Linux, macOS, Windows, Android, JavaScript [2] |
Type | Machine learning library |
License | Apache 2.0 |
Website | tensorflow |
Part of a series on |
Machine learning and data mining |
---|
TensorFlow is a software library for machine learning and artificial intelligence. It can be used across a range of tasks, but is used mainly for training and inference of neural networks. [3] [4] It is one of the most popular deep learning frameworks, alongside others such as PyTorch and PaddlePaddle. [5] [6] It is free and open-source software released under the Apache License 2.0.
It was developed by the Google Brain team for Google's internal use in research and production. [7] [8] [9] The initial version was released under the Apache License 2.0 in 2015. [1] [10] Google released an updated version, TensorFlow 2.0, in September 2019. [11]
TensorFlow can be used in a wide variety of programming languages, including Python, JavaScript, C++, and Java, [12] facilitating its use in a range of applications in many sectors.
Starting in 2011, Google Brain built DistBelief as a proprietary machine learning system based on deep learning neural networks. Its use grew rapidly across diverse Alphabet companies in both research and commercial applications. [13] [14] Google assigned multiple computer scientists, including Jeff Dean, to simplify and refactor the codebase of DistBelief into a faster, more robust application-grade library, which became TensorFlow. [15] In 2009, the team, led by Geoffrey Hinton, had implemented generalized backpropagation and other improvements, which allowed generation of neural networks with substantially higher accuracy, for instance a 25% reduction in errors in speech recognition. [16]
TensorFlow is Google Brain's second-generation system. Version 1.0.0 was released on February 11, 2017. [17] While the reference implementation runs on single devices, TensorFlow can run on multiple CPUs and GPUs (with optional CUDA and SYCL extensions for general-purpose computing on graphics processing units). [18] TensorFlow is available on 64-bit Linux, macOS, Windows, and mobile computing platforms including Android and iOS.[ citation needed ]
Its flexible architecture allows for easy deployment of computation across a variety of platforms (CPUs, GPUs, TPUs), and from desktops to clusters of servers to mobile and edge devices.
TensorFlow computations are expressed as stateful dataflow graphs. The name TensorFlow derives from the operations that such neural networks perform on multidimensional data arrays, which are referred to as tensors . [19] During the Google I/O Conference in June 2016, Jeff Dean stated that 1,500 repositories on GitHub mentioned TensorFlow, of which only 5 were from Google. [20]
In March 2018, Google announced TensorFlow.js version 1.0 for machine learning in JavaScript. [21]
In Jan 2019, Google announced TensorFlow 2.0. [22] It became officially available in September 2019. [11]
In May 2019, Google announced TensorFlow Graphics for deep learning in computer graphics. [23]
In May 2016, Google announced its Tensor processing unit (TPU), an application-specific integrated circuit (ASIC, a hardware chip) built specifically for machine learning and tailored for TensorFlow. A TPU is a programmable AI accelerator designed to provide high throughput of low-precision arithmetic (e.g., 8-bit), and oriented toward using or running models rather than training them. Google announced they had been running TPUs inside their data centers for more than a year, and had found them to deliver an order of magnitude better-optimized performance per watt for machine learning. [24]
In May 2017, Google announced the second-generation, as well as the availability of the TPUs in Google Compute Engine. [25] The second-generation TPUs deliver up to 180 teraflops of performance, and when organized into clusters of 64 TPUs, provide up to 11.5 petaflops.[ citation needed ]
In May 2018, Google announced the third-generation TPUs delivering up to 420 teraflops of performance and 128 GB high bandwidth memory (HBM). Cloud TPU v3 Pods offer 100+ petaflops of performance and 32 TB HBM. [26]
In February 2018, Google announced that they were making TPUs available in beta on the Google Cloud Platform. [27]
In July 2018, the Edge TPU was announced. Edge TPU is Google's purpose-built ASIC chip designed to run TensorFlow Lite machine learning (ML) models on small client computing devices such as smartphones [28] known as edge computing.
In May 2017, Google announced a software stack specifically for mobile development, TensorFlow Lite. [29] In January 2019, the TensorFlow team released a developer preview of the mobile GPU inference engine with OpenGL ES 3.1 Compute Shaders on Android devices and Metal Compute Shaders on iOS devices. [30] In May 2019, Google announced that their TensorFlow Lite Micro (also known as TensorFlow Lite for Microcontrollers) and ARM's uTensor would be merging. [31]
As TensorFlow's market share among research papers was declining to the advantage of PyTorch, [32] the TensorFlow Team announced a release of a new major version of the library in September 2019. TensorFlow 2.0 introduced many changes, the most significant being TensorFlow eager, which changed the automatic differentiation scheme from the static computational graph to the "Define-by-Run" scheme originally made popular by Chainer and later PyTorch. [32] Other major changes included removal of old libraries, cross-compatibility between trained models on different versions of TensorFlow, and significant improvements to the performance on GPU. [33]
AutoDifferentiation is the process of automatically calculating the gradient vector of a model with respect to each of its parameters. With this feature, TensorFlow can automatically compute the gradients for the parameters in a model, which is useful to algorithms such as backpropagation which require gradients to optimize performance. [34] To do so, the framework must keep track of the order of operations done to the input Tensors in a model, and then compute the gradients with respect to the appropriate parameters. [34]
TensorFlow includes an “eager execution” mode, which means that operations are evaluated immediately as opposed to being added to a computational graph which is executed later. [35] Code executed eagerly can be examined step-by step-through a debugger, since data is augmented at each line of code rather than later in a computational graph. [35] This execution paradigm is considered to be easier to debug because of its step by step transparency. [35]
In both eager and graph executions, TensorFlow provides an API for distributing computation across multiple devices with various distribution strategies. [36] This distributed computing can often speed up the execution of training and evaluating of TensorFlow models and is a common practice in the field of AI. [36] [37]
To train and assess models, TensorFlow provides a set of loss functions (also known as cost functions). [38] Some popular examples include mean squared error (MSE) and binary cross entropy (BCE). [38]
In order to assess the performance of machine learning models, TensorFlow gives API access to commonly used metrics. Examples include various accuracy metrics (binary, categorical, sparse categorical) along with other metrics such as Precision, Recall, and Intersection-over-Union (IoU). [39]
TensorFlow.nn is a module for executing primitive neural network operations on models. [40] Some of these operations include variations of convolutions (1/2/3D, Atrous, depthwise), activation functions (Softmax, RELU, GELU, Sigmoid, etc.) and their variations, and other operations (max-pooling, bias-add, etc.). [40]
TensorFlow offers a set of optimizers for training neural networks, including ADAM, ADAGRAD, and Stochastic Gradient Descent (SGD). [41] When training a model, different optimizers offer different modes of parameter tuning, often affecting a model's convergence and performance. [42]
TensorFlow serves as a core platform and library for machine learning. TensorFlow's APIs use Keras to allow users to make their own machine-learning models. [33] [43] In addition to building and training their model, TensorFlow can also help load the data to train the model, and deploy it using TensorFlow Serving. [44]
TensorFlow provides a stable Python Application Program Interface (API), [45] as well as APIs without backwards compatibility guarantee for Javascript, [46] C++, [47] and Java. [48] [12] Third-party language binding packages are also available for C#, [49] [50] Haskell, [51] Julia, [52] MATLAB, [53] Object Pascal, [54] R, [55] Scala, [56] Rust, [57] OCaml, [58] and Crystal. [59] Bindings that are now archived and unsupported include Go [60] and Swift. [61]
TensorFlow also has a library for machine learning in JavaScript. Using the provided JavaScript APIs, TensorFlow.js allows users to use either Tensorflow.js models or converted models from TensorFlow or TFLite, retrain the given models, and run on the web. [44] [62]
TensorFlow Lite has APIs for mobile apps or embedded devices to generate and deploy TensorFlow models. [63] These models are compressed and optimized in order to be more efficient and have a higher performance on smaller capacity devices. [64]
TensorFlow Lite uses FlatBuffers as the data serialization format for network models, eschewing the Protocol Buffers format used by standard TensorFlow models. [64]
TensorFlow Extended (abbrev. TFX) provides numerous components to perform all the operations needed for end-to-end production. [65] Components include loading, validating, and transforming data, tuning, training, and evaluating the machine learning model, and pushing the model itself into production. [44] [65]
Numpy is one of the most popular Python data libraries, and TensorFlow offers integration and compatibility with its data structures. [66] Numpy NDarrays, the library's native datatype, are automatically converted to TensorFlow Tensors in TF operations; the same is also true vice versa. [66] This allows for the two libraries to work in unison without requiring the user to write explicit data conversions. Moreover, the integration extends to memory optimization by having TF Tensors share the underlying memory representations of Numpy NDarrays whenever possible. [66]
TensorFlow also offers a variety of libraries and extensions to advance and extend the models and methods used. [67] For example, TensorFlow Recommenders and TensorFlow Graphics are libraries for their respective functionalities in recommendation systems and graphics, TensorFlow Federated provides a framework for decentralized data, and TensorFlow Cloud allows users to directly interact with Google Cloud to integrate their local code to Google Cloud. [68] Other add-ons, libraries, and frameworks include TensorFlow Model Optimization, TensorFlow Probability, TensorFlow Quantum, and TensorFlow Decision Forests. [67] [68]
Google also released Colaboratory, a TensorFlow Jupyter notebook environment that does not require any setup. [69] It runs on Google Cloud and allows users free access to GPUs and the ability to store and share notebooks on Google Drive. [70]
Google JAX is a machine learning framework for transforming numerical functions. [71] [72] [73] It is described as bringing together a modified version of autograd (automatic obtaining of the gradient function through differentiation of a function) and TensorFlow's XLA (Accelerated Linear Algebra). It is designed to follow the structure and workflow of NumPy as closely as possible and works with TensorFlow as well as other frameworks such as PyTorch. The primary functions of JAX are: [71]
GE Healthcare used TensorFlow to increase the speed and accuracy of MRIs in identifying specific body parts. [74] Google used TensorFlow to create DermAssist, a free mobile application that allows users to take pictures of their skin and identify potential health complications. [75] Sinovation Ventures used TensorFlow to identify and classify eye diseases from optical coherence tomography (OCT) scans. [75]
Twitter implemented TensorFlow to rank tweets by importance for a given user, and changed their platform to show tweets in order of this ranking. [76] Previously, tweets were simply shown in reverse chronological order. [76] The photo sharing app VSCO used TensorFlow to help suggest custom filters for photos. [75]
Google officially released RankBrain on October 26, 2015, backed by TensorFlow. [77]
InSpace, a virtual learning platform, used TensorFlow to filter out toxic chat messages in classrooms. [78] Liulishuo, an online English learning platform, utilized TensorFlow to create an adaptive curriculum for each student. [79] TensorFlow was used to accurately assess a student's current abilities, and also helped decide the best future content to show based on those capabilities. [79]
The e-commerce platform Carousell used TensorFlow to provide personalized recommendations for customers. [75] The cosmetics company ModiFace used TensorFlow to create an augmented reality experience for customers to test various shades of make-up on their face. [80]
TensorFlow is the foundation for the automated image-captioning software DeepDream. [81]
This is a comparison of web frameworks for front-end web development that are heavily reliant on JavaScript code for their behavior.
Etherpad is an open-source, web-based collaborative real-time editor, allowing authors to simultaneously edit a text document, and see all of the participants' edits in real-time, with the ability to display each author's text in their own color. There is also a chat box in the sidebar to allow meta communication.
Node.js is a cross-platform, open-source JavaScript runtime environment that can run on Windows, Linux, Unix, macOS, and more. Node.js runs on the V8 JavaScript engine, and executes JavaScript code outside a web browser.
Ember.js is an open-source JavaScript web framework that utilizes a component-service pattern. It is designed to allow developers to create scalable single-page web applications by incorporating common idioms, best practices, and patterns from other single-page-app ecosystem patterns into the framework.
Google Cloud Platform (GCP) is a suite of cloud computing services offered by Google that provides a series of modular cloud services including computing, data storage, data analytics, and machine learning, alongside a set of management tools. It runs on the same infrastructure that Google uses internally for its end-user products, such as Google Search, Gmail, and Google Docs, according to Verma et al. Registration requires a credit card or bank account details.
Eclipse Deeplearning4j is a programming library written in Java for the Java virtual machine (JVM). It is a framework with wide support for deep learning algorithms. Deeplearning4j includes implementations of the restricted Boltzmann machine, deep belief net, deep autoencoder, stacked denoising autoencoder and recursive neural tensor network, word2vec, doc2vec, and GloVe. These algorithms all include distributed parallel versions that integrate with Apache Hadoop and Spark.
WebAssembly (Wasm) defines a portable binary-code format and a corresponding text format for executable programs as well as software interfaces for facilitating communication between such programs and their host environment.
The following tables compare notable software frameworks, libraries, and computer programs for deep learning applications.
Tensor Processing Unit (TPU) is an AI accelerator application-specific integrated circuit (ASIC) developed by Google for neural network machine learning, using Google's own TensorFlow software. Google began using TPUs internally in 2015, and in 2018 made them available for third-party use, both as part of its cloud infrastructure and by offering a smaller version of the chip for sale.
Keras is an open-source library that provides a Python interface for artificial neural networks. Keras was first independent software, then integrated into the TensorFlow library, and later supporting more. "Keras 3 is a full rewrite of Keras [and can be used] as a low-level cross-framework language to develop custom components such as layers, models, or metrics that can be used in native workflows in JAX, TensorFlow, or PyTorch — with one codebase." Keras 3 will be the default Keras version for TensorFlow 2.16 onwards, but Keras 2 can still be used.
Google AI is a division of Google dedicated to artificial intelligence. It was announced at Google I/O 2017 by CEO Sundar Pichai.
ML.NET is a free software machine learning library for the C# and F# programming languages. It also supports Python models when used together with NimbusML. The preview release of ML.NET included transforms for feature engineering like n-gram creation, and learners to handle binary classification, multi-class classification, and regression tasks. Additional ML tasks like anomaly detection and recommendation systems have since been added, and other approaches like deep learning will be included in future versions.
The bfloat16 floating-point format is a computer number format occupying 16 bits in computer memory; it represents a wide dynamic range of numeric values by using a floating radix point. This format is a shortened (16-bit) version of the 32-bit IEEE 754 single-precision floating-point format (binary32) with the intent of accelerating machine learning and near-sensor computing. It preserves the approximate dynamic range of 32-bit floating-point numbers by retaining 8 exponent bits, but supports only an 8-bit precision rather than the 24-bit significand of the binary32 format. More so than single-precision 32-bit floating-point numbers, bfloat16 numbers are unsuitable for integer calculations, but this is not their intended use. Bfloat16 is used to reduce the storage requirements and increase the calculation speed of machine learning algorithms.
Flux is an open-source machine-learning software library and ecosystem written in Julia. Its current stable release is v0.14.5 . It has a layer-stacking-based interface for simpler models, and has a strong support on interoperability with other Julia packages instead of a monolithic design. For example, GPU support is implemented transparently by CuArrays.jl. This is in contrast to some other machine learning frameworks which are implemented in other languages with Julia bindings, such as TensorFlow.jl, and thus are more limited by the functionality present in the underlying implementation, which is often in C or C++. Flux joined NumFOCUS as an affiliated project in December of 2021.
Amazon SageMaker AI is a cloud-based machine-learning platform that allows the creation, training, and deployment by developers of machine-learning (ML) models on the cloud. It can be used to deploy ML models on embedded systems and edge-devices. The platform was launched in November 2017.
Kubeflow is an open-source platform for machine learning and MLOps on Kubernetes introduced by Google. The different stages in a typical machine learning lifecycle are represented with different software components in Kubeflow, including model development (Kubeflow Notebooks), model training (Kubeflow Pipelines,Kubeflow Training Operator), model serving (KServe), and automated machine learning (Katib).
OpenVINO is an open-source software toolkit for optimizing and deploying deep learning models. It enables programmers to develop scalable and efficient AI solutions with relatively few lines of code. It supports several popular model formats and categories, such as large language models, computer vision, and generative AI.
The Fashion MNIST dataset is a large freely available database of fashion images that is commonly used for training and testing various machine learning systems. Fashion-MNIST was intended to serve as a replacement for the original MNIST database for benchmarking machine learning algorithms, as it shares the same image size, data format and the structure of training and testing splits.
Hugging Face, Inc. is an American company incorporated under the Delaware General Corporation Law and based in New York City that develops computation tools for building applications using machine learning. It is most notable for its transformers library built for natural language processing applications and its platform that allows users to share machine learning models and datasets and showcase their work.
MobileNet is a family of convolutional neural network (CNN) architectures designed for image classification, object detection, and other computer vision tasks. They are designed for small size, low latency, and low power consumption, making them suitable for on-device inference and edge computing on resource-constrained devices like mobile phones and embedded systems. They were originally designed to be run efficiently on mobile devices with TensorFlow Lite.
operations like sin, * (matrix multiplication), .* (element-wise multiplication), etc [..]. Compare to Python, which requires learning specialized namespaced functions like tf.matmul.