TensorFlow
{{Short description|Machine learning software library}}
{{Use mdy dates|date=November 2017}}
{{Use American English|date=April 2025}}
{{Infobox software
| name = TensorFlow
| logo = TensorFlow logo.svg
| logo caption = TensorFlow logo
| author =
| developer = Google Brain Team
| released = {{Start date and age|2015|11|09}}
| latest release version = 2.18.0
| latest release date = {{Start date and age|2024|10|25}}
| repo = {{URL|https://github.com/tensorflow/tensorflow}}
| programming language = Python, C++, CUDA
| platform = Linux, macOS, Windows, Android, JavaScript{{cite web |title=TensorFlow.js |url=https://js.tensorflow.org/faq/ |access-date=June 28, 2018 |archive-date=May 6, 2018 |archive-url=https://web.archive.org/web/20180506083002/https://js.tensorflow.org/faq/ |url-status=live}}
| genre = Machine learning library
| license = Apache 2.0
| website = {{URL|tensorflow.org}}
}}
{{Machine learning}}
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.{{Cite conference|conference=Proceedings of the 12th USENIX Symposium on Operating Systems Design and Implementation (OSDI ’16).|date=2016|title=TensorFlow: A System for Large-Scale Machine Learning|url=https://www.usenix.org/system/files/conference/osdi16/osdi16-abadi.pdf|last1=Abadi|first1=Martín|last2=Barham|first2=Paul|last3=Chen|first3=Jianmin|last4=Chen|first4=Zhifeng|last5=Davis|first5=Andy|last6=Dean|first6=Jeffrey|last7=Devin|first7=Matthieu|last8=Ghemawat|first8=Sanjay|last9=Irving|first9=Geoffrey|last10=Isard|first10=Michael|last11=Kudlur|first11=Manjunath|last12=Levenberg|first12=Josh|last13=Monga|first13=Rajat|last14=Moore|first14=Sherry|last15=Murray|first15=Derek G.|last16=Steiner|first16=Benoit|last17=Tucker|first17=Paul|last18=Vasudevan|first18=Vijay|last19=Warden|first19=Pete|last20=Wicke|first20=Martin|last21=Yu|first21=Yuan|last22=Zheng|first22=Xiaoqiang|arxiv=1605.08695|access-date=October 26, 2020|archive-date=December 12, 2020|archive-url=https://web.archive.org/web/20201212042511/https://www.usenix.org/system/files/conference/osdi16/osdi16-abadi.pdf|url-status=live}}{{cite AV media|url=https://www.youtube.com/watch?v=oZikw5k_2FM| archive-url=https://ghostarchive.org/varchive/youtube/20211111/oZikw5k_2FM| archive-date=November 11, 2021 |url-status=live|title=TensorFlow: Open source machine learning|year= 2015|publisher=Google|ref={{harvid|Video clip by Google about TensorFlow|2015}}}}{{cbignore}} "It is machine learning software being used for various kinds of perceptual and language understanding tasks" – Jeffrey Dean, minute 0:47 / 2:17 from YouTube clip It is one of the most popular deep learning frameworks, alongside others such as PyTorch.{{Cite web|url=https://github.com/cncf/velocity|title=Top 30 Open Source Projects.|website=Open Source Project Velocity by CNCF|access-date=October 12, 2023|archive-date=September 3, 2023|archive-url=https://web.archive.org/web/20230903024925/https://github.com/cncf/velocity|url-status=live}} 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.{{harvnb|Video clip by Google about TensorFlow|2015}} at minute 0:15/2:17{{harvnb|Video clip by Google about TensorFlow|2015}} at minute 0:26/2:17{{harvnb|Dean et al|2015|p=2}} The initial version was released under the Apache License 2.0 in 2015.{{cite web |title=Credits |url=https://tensorflow.org/about |website=TensorFlow.org |access-date=November 10, 2015 |archive-date=November 17, 2015 |archive-url=https://web.archive.org/web/20151117032147/https://tensorflow.org/about |url-status=live}}{{cite web |last1=Metz |first1=Cade |title=Google Just Open Sourced TensorFlow, Its Artificial Intelligence Engine |url=https://www.wired.com/2015/11/google-open-sources-its-artificial-intelligence-engine/ |website=Wired |access-date=November 10, 2015 |date=November 9, 2015 |archive-date=November 9, 2015 |archive-url=https://web.archive.org/web/20151109142618/https://www.wired.com/2015/11/google-open-sources-its-artificial-intelligence-engine/ |url-status=live}} Google released an updated version, TensorFlow 2.0, in September 2019.
TensorFlow can be used in a wide variety of programming languages, including Python, JavaScript, C++, and Java,{{cite web|title=API Documentation|url=https://www.tensorflow.org/api_docs/|access-date=June 27, 2018|archive-date=November 16, 2015|archive-url=https://web.archive.org/web/20151116154736/https://www.tensorflow.org/api_docs/|url-status=live}}, facilitating its use in a range of applications in many sectors.
History
= DistBelief =
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.{{cite web |last1=Dean |first1=Jeff |last2=Monga |first2=Rajat |first3=Sanjay |last3=Ghemawat |display-authors=2 |author-link1=Jeff Dean (computer scientist) |title=TensorFlow: Large-scale machine learning on heterogeneous systems |url=http://download.tensorflow.org/paper/whitepaper2015.pdf |website=TensorFlow.org |publisher=Google Research |access-date=November 10, 2015 |date=November 9, 2015 |ref={{harvid|Dean et al|2015}} |archive-date=November 20, 2015 |archive-url=https://web.archive.org/web/20151120004649/http://download.tensorflow.org/paper/whitepaper2015.pdf |url-status=live}}{{cite web |last1=Perez |first1=Sarah |title=Google Open-Sources The Machine Learning Tech Behind Google Photos Search, Smart Reply And More |url=https://techcrunch.com/2015/11/09/google-open-sources-the-machine-learning-tech-behind-google-photos-search-smart-reply-and-more/ |website=TechCrunch |access-date=November 11, 2015 |date=November 9, 2015 |archive-date=November 9, 2015 |archive-url=https://web.archive.org/web/20151109150138/https://techcrunch.com/2015/11/09/google-open-sources-the-machine-learning-tech-behind-google-photos-search-smart-reply-and-more/ |url-status=live}} 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.{{cite web |last1=Oremus |first1=Will |title=What Is TensorFlow, and Why Is Google So Excited About It? |url=https://www.slate.com/blogs/future_tense/2015/11/09/google_s_tensorflow_is_open_source_and_it_s_about_to_be_a_huge_huge_deal.html |website=Slate |access-date=November 11, 2015 |date=November 9, 2015 |archive-date=November 10, 2015 |archive-url=https://web.archive.org/web/20151110021146/https://www.slate.com/blogs/future_tense/2015/11/09/google_s_tensorflow_is_open_source_and_it_s_about_to_be_a_huge_huge_deal.html |url-status=live}} 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.{{cite web |last1=Ward-Bailey |first1=Jeff |title=Google chairman: We're making 'real progress' on artificial intelligence |url=https://www.csmonitor.com/Technology/2015/0914/Google-chairman-We-re-making-real-progress-on-artificial-intelligence |website=CSMonitor |access-date=November 25, 2015 |date=November 25, 2015 |archive-date=September 16, 2015 |archive-url=https://web.archive.org/web/20150916223243/https://www.csmonitor.com/Technology/2015/0914/Google-chairman-We-re-making-real-progress-on-artificial-intelligence |url-status=live}}
= TensorFlow =
TensorFlow is Google Brain's second-generation system. Version 1.0.0 was released on February 11, 2017.{{cite journal|url=https://github.com/tensorflow/tensorflow/blob/07bb8ea2379bd459832b23951fb20ec47f3fdbd4/RELEASE.md|title=Tensorflow Release 1.0.0|website=GitHub|year=2022|doi=10.5281/zenodo.4724125|author1=TensorFlow Developers|access-date=July 24, 2017|archive-date=February 27, 2021|archive-url=https://web.archive.org/web/20210227171533/https://github.com/tensorflow/tensorflow/blob/07bb8ea2379bd459832b23951fb20ec47f3fdbd4/RELEASE.md|url-status=live}} 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).{{cite news |last1=Metz |first1=Cade |title=TensorFlow, Google's Open Source AI, Points to a Fast-Changing Hardware World |url=https://www.wired.com/2015/11/googles-open-source-ai-tensorflow-signals-fast-changing-hardware-world/ |access-date=November 11, 2015 |magazine=Wired |date=November 10, 2015 |archive-date=November 11, 2015 |archive-url=https://web.archive.org/web/20151111163641/http://www.wired.com/2015/11/googles-open-source-ai-tensorflow-signals-fast-changing-hardware-world/ |url-status=live}} TensorFlow is available on 64-bit Linux, macOS, Windows, and mobile computing platforms including Android and iOS.{{Cite web |last=Kudale |first=Aniket Eknath |date=June 8, 2020 |title=Building a Facial Expression Recognition App Using TensorFlow.js |url=https://www.opensourceforu.com/2020/06/building-a-facial-expression-recognition-app-using-tensorflow-js/ |url-status=live |archive-url=https://web.archive.org/web/20241011214722/https://www.opensourceforu.com/2020/06/building-a-facial-expression-recognition-app-using-tensorflow-js/ |archive-date=October 11, 2024 |access-date=April 19, 2025 |website=Open Source For U}}{{Cite web |last=MSV |first=Janakiram |date=February 24, 2021 |title=The Ultimate Guide to Machine Learning Frameworks |url=https://thenewstack.io/the-ultimate-guide-to-machine-learning-frameworks/ |url-status=live |archive-url=https://web.archive.org/web/20241224100937/https://thenewstack.io/the-ultimate-guide-to-machine-learning-frameworks/ |archive-date=December 24, 2024 |access-date=April 19, 2025 |website=The New Stack}}
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.{{cite web |url=https://www.tensorflow.org/guide/tensor |title=Introduction to tensors |publisher=tensorflow.org |access-date=March 3, 2024 |archive-date=May 26, 2024 |archive-url=https://web.archive.org/web/20240526120806/https://www.tensorflow.org/guide/tensor |url-status=live}} 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.[https://www.youtube.com/watch?v=Rnm83GqgqPE Machine Learning: Google I/O 2016 Minute 07:30/44:44 ]. {{Webarchive|url=https://web.archive.org/web/20161221095258/https://www.youtube.com/watch?v=Rnm83GqgqPE |date=December 21, 2016}}. Retrieved June 5, 2016.
In March 2018, Google announced TensorFlow.js version 1.0 for machine learning in JavaScript.{{cite web|url=https://medium.com/tensorflow/introducing-tensorflow-js-machine-learning-in-javascript-bf3eab376db|title=Introducing TensorFlow.js: Machine Learning in Javascript|last=TensorFlow|date=March 30, 2018|website=Medium|access-date=May 24, 2019|archive-date=March 30, 2018|archive-url=https://web.archive.org/web/20180330180144/https://medium.com/tensorflow/introducing-tensorflow-js-machine-learning-in-javascript-bf3eab376db|url-status=live}}
In Jan 2019, Google announced TensorFlow 2.0.{{cite web|url=https://medium.com/tensorflow/whats-coming-in-tensorflow-2-0-d3663832e9b8|title=What's coming in TensorFlow 2.0|last=TensorFlow|date=January 14, 2019|website=Medium|access-date=May 24, 2019|archive-date=January 14, 2019|archive-url=https://web.archive.org/web/20190114181937/https://medium.com/tensorflow/whats-coming-in-tensorflow-2-0-d3663832e9b8|url-status=live}} It became officially available in September 2019.{{cite web|url=https://medium.com/tensorflow/tensorflow-2-0-is-now-available-57d706c2a9ab|title=TensorFlow 2.0 is now available!|last=TensorFlow|date=September 30, 2019|website=Medium|access-date=November 24, 2019|archive-date=October 7, 2019|archive-url=https://web.archive.org/web/20191007214705/https://medium.com/tensorflow/tensorflow-2-0-is-now-available-57d706c2a9ab|url-status=live}}
In May 2019, Google announced TensorFlow Graphics for deep learning in computer graphics.{{cite web|url=https://medium.com/tensorflow/introducing-tensorflow-graphics-computer-graphics-meets-deep-learning-c8e3877b7668|title=Introducing TensorFlow Graphics: Computer Graphics Meets Deep Learning|last=TensorFlow|date=May 9, 2019|website=Medium|access-date=May 24, 2019|archive-date=May 9, 2019|archive-url=https://web.archive.org/web/20190509204620/https://medium.com/tensorflow/introducing-tensorflow-graphics-computer-graphics-meets-deep-learning-c8e3877b7668|url-status=live}}
= Tensor processing unit (TPU) =
{{main|Tensor processing unit}}
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.{{cite web |author-link1=Norman Jouppi |last1=Jouppi |first1=Norm |title=Google supercharges machine learning tasks with TPU custom chip |url=https://cloudplatform.googleblog.com/2016/05/Google-supercharges-machine-learning-tasks-with-custom-chip.html |website=Google Cloud Platform Blog |access-date=May 19, 2016 |archive-date=May 18, 2016 |archive-url=https://web.archive.org/web/20160518201516/https://cloudplatform.googleblog.com/2016/05/Google-supercharges-machine-learning-tasks-with-custom-chip.html |url-status=live}}
In May 2017, Google announced the second-generation, as well as the availability of the TPUs in Google Compute Engine.{{cite news|url=https://www.blog.google/topics/google-cloud/google-cloud-offer-tpus-machine-learning/|title=Build and train machine learning models on our new Google Cloud TPUs|date=May 17, 2017|work=Google|access-date=May 18, 2017|archive-date=May 17, 2017|archive-url=https://web.archive.org/web/20170517182035/https://blog.google/topics/google-cloud/google-cloud-offer-tpus-machine-learning/|url-status=live}} 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|date=March 2024}}
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.{{cite web|url=https://cloud.google.com/tpu/|title=Cloud TPU|website=Google Cloud|access-date=May 24, 2019|archive-date=May 17, 2017|archive-url=https://web.archive.org/web/20170517174135/https://cloud.google.com/tpu/|url-status=live}}
In February 2018, Google announced that they were making TPUs available in beta on the Google Cloud Platform.{{cite news|url=https://cloudplatform.googleblog.com/2018/02/Cloud-TPU-machine-learning-accelerators-now-available-in-beta.html|title=Cloud TPU machine learning accelerators now available in beta|work=Google Cloud Platform Blog|access-date=February 12, 2018|archive-date=February 12, 2018|archive-url=https://web.archive.org/web/20180212141508/https://cloudplatform.googleblog.com/2018/02/Cloud-TPU-machine-learning-accelerators-now-available-in-beta.html|url-status=live}}
= Edge TPU =
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{{cite web|url=https://beebom.com/google-announces-edge-tpu-cloud-iot-edge-at-cloud-next-2018/|title=Google Announces Edge TPU, Cloud IoT Edge at Cloud Next 2018|last=Kundu|first=Kishalaya|date=July 26, 2018|website=Beebom|language=en-US|access-date=February 2, 2019|archive-date=May 26, 2024|archive-url=https://web.archive.org/web/20240526120854/https://beebom.com/google-announces-edge-tpu-cloud-iot-edge-at-cloud-next-2018/|url-status=live}} known as edge computing.
= TensorFlow Lite =
In May 2017, Google announced a software stack specifically for mobile development, TensorFlow Lite.{{cite web|url=https://www.theverge.com/2017/5/17/15645908/google-ai-tensorflowlite-machine-learning-announcement-io-2017|title=Google's new machine learning framework is going to put more AI on your phone|date=May 17, 2017|access-date=May 19, 2017|archive-date=May 17, 2017|archive-url=https://web.archive.org/web/20170517233339/https://www.theverge.com/2017/5/17/15645908/google-ai-tensorflowlite-machine-learning-announcement-io-2017|url-status=live}} 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.{{cite web|url=https://medium.com/tensorflow/tensorflow-lite-now-faster-with-mobile-gpus-developer-preview-e15797e6dee7|title=TensorFlow Lite Now Faster with Mobile GPUs (Developer Preview)|last=TensorFlow|date=January 16, 2019|website=Medium|access-date=May 24, 2019|archive-date=January 16, 2019|archive-url=https://web.archive.org/web/20190116183459/https://medium.com/tensorflow/tensorflow-lite-now-faster-with-mobile-gpus-developer-preview-e15797e6dee7|url-status=live}} In May 2019, Google announced that their TensorFlow Lite Micro (also known as TensorFlow Lite for Microcontrollers) and ARM's uTensor would be merging.{{cite web|url=https://os.mbed.com/blog/entry/uTensor-and-Tensor-Flow-Announcement/|title=uTensor and Tensor Flow Announcement {{!}} Mbed|website=os.mbed.com|access-date=May 24, 2019|archive-date=May 9, 2019|archive-url=https://web.archive.org/web/20190509195115/https://os.mbed.com/blog/entry/uTensor-and-Tensor-Flow-Announcement/|url-status=live}}
= TensorFlow 2.0 =
As TensorFlow's market share among research papers was declining to the advantage of PyTorch,{{cite web|url=https://thegradient.pub/state-of-ml-frameworks-2019-pytorch-dominates-research-tensorflow-dominates-industry/|title=The State of Machine Learning Frameworks in 2019|publisher=The Gradient|first1=Horace|last1=He|date=October 10, 2019|access-date=May 22, 2020|archive-date=October 10, 2019|archive-url=https://web.archive.org/web/20191010161542/https://thegradient.pub/state-of-ml-frameworks-2019-pytorch-dominates-research-tensorflow-dominates-industry/|url-status=live}} 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. 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.{{cite book|last1=Ciaramella|first1=Alberto|last2=Ciaramella|first2=Marco|author-link=Alberto Ciaramella|title=Introduction to Artificial Intelligence: from data analysis to generative AI|date=July 2024|publisher=Intellisemantic Editions |isbn=9788894787603}}
Features
= AutoDifferentiation =
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.{{Cite web|title=Introduction to gradients and automatic differentiation|url=https://www.tensorflow.org/guide/autodiff|access-date=November 4, 2021|website=TensorFlow|language=en|archive-date=October 28, 2021|archive-url=https://web.archive.org/web/20211028054417/https://www.tensorflow.org/guide/autodiff|url-status=live}} 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.
= Eager execution =
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.{{Cite web|title=Eager execution {{!}} TensorFlow Core|url=https://www.tensorflow.org/guide/eager|access-date=November 4, 2021|website=TensorFlow|language=en|archive-date=November 4, 2021|archive-url=https://web.archive.org/web/20211104011333/https://www.tensorflow.org/guide/eager|url-status=live}} 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. This execution paradigm is considered to be easier to debug because of its step by step transparency.
= Distribute =
In both eager and graph executions, TensorFlow provides an API for distributing computation across multiple devices with various distribution strategies.{{Cite web|title=Module: tf.distribute {{!}} TensorFlow Core v2.6.1|url=https://www.tensorflow.org/api_docs/python/tf/distribute|access-date=November 4, 2021|website=TensorFlow|language=en|archive-date=May 26, 2024|archive-url=https://web.archive.org/web/20240526120808/https://www.tensorflow.org/api_docs/python/tf/distribute|url-status=live}} 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.{{Cite book|last=Sigeru.|first=Omatu|url=http://worldcat.org/oclc/980886715|title=Distributed Computing and Artificial Intelligence, 11th International Conference|date=2014|publisher=Springer International Publishing|isbn=978-3-319-07593-8|oclc=980886715|access-date=November 4, 2021|archive-date=May 26, 2024|archive-url=https://web.archive.org/web/20240526120810/https://search.worldcat.org/title/980886715|url-status=live}}
= Losses =
To train and assess models, TensorFlow provides a set of loss functions (also known as cost functions).{{Cite web|title=Module: tf.losses {{!}} TensorFlow Core v2.6.1|url=https://www.tensorflow.org/api_docs/python/tf/losses|access-date=November 4, 2021|website=TensorFlow|language=en|archive-date=October 27, 2021|archive-url=https://web.archive.org/web/20211027133546/https://www.tensorflow.org/api_docs/python/tf/losses|url-status=live}} Some popular examples include mean squared error (MSE) and binary cross entropy (BCE).
= Metrics =
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).{{Cite web|title=Module: tf.metrics {{!}} TensorFlow Core v2.6.1|url=https://www.tensorflow.org/api_docs/python/tf/metrics|access-date=November 4, 2021|website=TensorFlow|language=en|archive-date=November 4, 2021|archive-url=https://web.archive.org/web/20211104011333/https://www.tensorflow.org/api_docs/python/tf/metrics|url-status=live}}
= TF.nn =
TensorFlow.nn is a module for executing primitive neural network operations on models.{{Cite web|title=Module: tf.nn {{!}} TensorFlow Core v2.7.0|url=https://www.tensorflow.org/api_docs/python/tf/nn|access-date=November 6, 2021|website=TensorFlow|language=en|archive-date=May 26, 2024|archive-url=https://web.archive.org/web/20240526120809/https://www.tensorflow.org/api_docs/python/tf/nn|url-status=live}} 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.).
= Optimizers =
TensorFlow offers a set of optimizers for training neural networks, including ADAM, ADAGRAD, and Stochastic Gradient Descent (SGD).{{Cite web|title=Module: tf.optimizers {{!}} TensorFlow Core v2.7.0|url=https://www.tensorflow.org/api_docs/python/tf/optimizers|access-date=November 6, 2021|website=TensorFlow|language=en|archive-date=October 30, 2021|archive-url=https://web.archive.org/web/20211030152658/https://www.tensorflow.org/api_docs/python/tf/optimizers|url-status=live}} When training a model, different optimizers offer different modes of parameter tuning, often affecting a model's convergence and performance.{{Cite book|last1=Dogo|first1=E. M.|last2=Afolabi|first2=O. J.|last3=Nwulu|first3=N. I.|last4=Twala|first4=B.|last5=Aigbavboa|first5=C. O.|title=2018 International Conference on Computational Techniques, Electronics and Mechanical Systems (CTEMS)|chapter=A Comparative Analysis of Gradient Descent-Based Optimization Algorithms on Convolutional Neural Networks|date=December 2018|chapter-url=https://ieeexplore.ieee.org/document/8769211|pages=92–99|doi=10.1109/CTEMS.2018.8769211|isbn=978-1-5386-7709-4|s2cid=198931032|access-date=July 25, 2023|archive-date=May 26, 2024|archive-url=https://web.archive.org/web/20240526120806/https://ieeexplore.ieee.org/document/8769211|url-status=live}}
Usage and extensions
= TensorFlow =
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.{{Cite web|title=TensorFlow Core {{!}} Machine Learning for Beginners and Experts|url=https://www.tensorflow.org/overview|access-date=November 4, 2021|website=TensorFlow|language=en|archive-date=January 20, 2023|archive-url=https://web.archive.org/web/20230120082541/https://www.tensorflow.org/overview|url-status=live}} 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.{{Cite web|title=Introduction to TensorFlow|url=https://www.tensorflow.org/learn|access-date=October 28, 2021|website=TensorFlow|language=en|archive-date=January 20, 2023|archive-url=https://web.archive.org/web/20230120082541/https://www.tensorflow.org/learn|url-status=live}}
TensorFlow provides a stable Python Application Program Interface (API),{{Cite web|title=All symbols in TensorFlow 2 {{!}} TensorFlow Core v2.7.0|url=https://www.tensorflow.org/api_docs/python/tf/all_symbols|access-date=November 6, 2021|website=TensorFlow|language=en|archive-date=November 6, 2021|archive-url=https://web.archive.org/web/20211106055527/https://www.tensorflow.org/api_docs/python/tf/all_symbols|url-status=live}} as well as APIs without backwards compatibility guarantee for Javascript,{{Cite web|title=TensorFlow.js|url=https://js.tensorflow.org/|access-date=November 6, 2021|website=js.tensorflow.org|archive-date=May 26, 2024|archive-url=https://web.archive.org/web/20240526120808/https://www.tensorflow.org/js|url-status=live}} C++,{{Cite web|title=TensorFlow C++ API Reference {{!}} TensorFlow Core v2.7.0|url=https://www.tensorflow.org/api_docs/cc|access-date=November 6, 2021|website=TensorFlow|language=en|archive-date=January 20, 2023|archive-url=https://web.archive.org/web/20230120082630/https://www.tensorflow.org/api_docs/cc|url-status=live}} and Java.{{Cite web|title=org.tensorflow {{!}} Java|url=https://www.tensorflow.org/api_docs/java/org/tensorflow/package-summary|access-date=November 6, 2021|website=TensorFlow|language=en|archive-date=November 6, 2021|archive-url=https://web.archive.org/web/20211106054023/https://www.tensorflow.org/api_docs/java/org/tensorflow/package-summary|url-status=live}} Third-party language binding packages are also available for C#,{{cite web|last=Icaza|first=Miguel de|date=February 17, 2018|title=TensorFlowSharp: TensorFlow API for .NET languages|website=GitHub|url=https://github.com/migueldeicaza/TensorFlowSharp|access-date=February 18, 2018|archive-date=July 24, 2017|archive-url=https://web.archive.org/web/20170724080201/https://github.com/migueldeicaza/TensorFlowSharp|url-status=live}}{{cite web|last=Chen|first=Haiping|date=December 11, 2018|title=TensorFlow.NET: .NET Standard bindings for TensorFlow|website=GitHub|url=https://github.com/SciSharp/TensorFlow.NET|access-date=December 11, 2018|archive-date=July 12, 2019|archive-url=https://web.archive.org/web/20190712123610/https://github.com/SciSharp/TensorFlow.NET|url-status=live}} Haskell,{{cite web |date=February 17, 2018 |title=haskell: Haskell bindings for TensorFlow |url=https://github.com/tensorflow/haskell|access-date=February 18, 2018 |publisher=tensorflow |archive-date=July 24, 2017 |archive-url=https://web.archive.org/web/20170724080229/https://github.com/tensorflow/haskell|url-status=live}} Julia,{{cite web|last=Malmaud|first=Jon|date=August 12, 2019|title=A Julia wrapper for TensorFlow|website=GitHub|url=https://github.com/malmaud/TensorFlow.jl|access-date=August 14, 2019|quote=operations like sin, * (matrix multiplication), .* (element-wise multiplication), etc [..]. Compare to Python, which requires learning specialized namespaced functions like tf.matmul.|archive-date=July 24, 2017|archive-url=https://web.archive.org/web/20170724080234/https://github.com/malmaud/TensorFlow.jl|url-status=live}} MATLAB,{{cite web|date=November 3, 2019|title=A MATLAB wrapper for TensorFlow Core|website=GitHub|url=https://github.com/asteinh/tensorflow.m|access-date=February 13, 2020|archive-date=September 14, 2020|archive-url=https://web.archive.org/web/20200914161638/https://github.com/asteinh/tensorflow.m|url-status=live}} Object Pascal,{{cite web|date=January 19, 2023|title=Use TensorFlow from Pascal (FreePascal, Lazarus, etc.)|website=GitHub|url=https://github.com/zsoltszakaly/tensorflowforpascal|access-date=January 20, 2023|archive-date=January 20, 2023|archive-url=https://web.archive.org/web/20230120083754/https://github.com/zsoltszakaly/tensorflowforpascal|url-status=live}} R,{{cite web|date=February 17, 2018|title=tensorflow: TensorFlow for R|url=https://github.com/rstudio/tensorflow|access-date=February 18, 2018|publisher=RStudio|archive-date=January 4, 2017|archive-url=https://web.archive.org/web/20170104081359/https://github.com/rstudio/tensorflow|url-status=live}} Scala,{{cite web|last=Platanios|first=Anthony|date=February 17, 2018|title=tensorflow_scala: TensorFlow API for the Scala Programming Language|website=GitHub|url=https://github.com/eaplatanios/tensorflow_scala|access-date=February 18, 2018|archive-date=February 18, 2019|archive-url=https://web.archive.org/web/20190218035307/https://github.com/eaplatanios/tensorflow_scala|url-status=live}} Rust,{{cite web|date=February 17, 2018|title=rust: Rust language bindings for TensorFlow|url=https://github.com/tensorflow/rust|access-date=February 18, 2018|publisher=tensorflow|archive-date=July 24, 2017|archive-url=https://web.archive.org/web/20170724080245/https://github.com/tensorflow/rust|url-status=live}} OCaml,{{cite web|last=Mazare|first=Laurent|date=February 16, 2018|title=tensorflow-ocaml: OCaml bindings for TensorFlow|website=GitHub|url=https://github.com/LaurentMazare/tensorflow-ocaml|access-date=February 18, 2018|archive-date=June 11, 2018|archive-url=https://web.archive.org/web/20180611155059/https://github.com/LaurentMazare/tensorflow-ocaml|url-status=live}} and Crystal.{{cite web|title=fazibear/tensorflow.cr|url=https://github.com/fazibear/tensorflow.cr|access-date=October 10, 2018|website=GitHub|language=en|archive-date=June 27, 2018|archive-url=https://web.archive.org/web/20180627120743/https://github.com/fazibear/tensorflow.cr|url-status=live}} Bindings that are now archived and unsupported include Go{{Cite web|title=tensorflow package - github.com/tensorflow/tensorflow/tensorflow/go - pkg.go.dev|url=https://pkg.go.dev/github.com/tensorflow/tensorflow/tensorflow/go|access-date=November 6, 2021|website=pkg.go.dev|archive-date=November 6, 2021|archive-url=https://web.archive.org/web/20211106054028/https://pkg.go.dev/github.com/tensorflow/tensorflow/tensorflow/go|url-status=live}} and Swift.{{Cite web|title=Swift for TensorFlow (In Archive Mode)|url=https://www.tensorflow.org/swift/guide/overview|access-date=November 6, 2021|website=TensorFlow|language=en|archive-date=November 6, 2021|archive-url=https://web.archive.org/web/20211106054024/https://www.tensorflow.org/swift/guide/overview|url-status=live}}
= TensorFlow.js =
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.{{Cite web|title=TensorFlow.js {{!}} Machine Learning for JavaScript Developers|url=https://www.tensorflow.org/js|access-date=October 28, 2021|website=TensorFlow|language=en|archive-date=November 4, 2021|archive-url=https://web.archive.org/web/20211104081918/https://www.tensorflow.org/js/|url-status=live}}
= LiteRT =
LiteRT, formerly known as TensorFlow Lite,{{Cite web|title=LiteRT Overview {{!}} Google AI Edge|url=https://ai.google.dev/edge/litert|access-date=May 7, 2025|website=Google AI for Developers|language=en}} has APIs for mobile apps or embedded devices to generate and deploy TensorFlow models.{{Cite web|title=TensorFlow Lite {{!}} ML for Mobile and Edge Devices|url=https://www.tensorflow.org/lite|access-date=November 1, 2021|website=TensorFlow|language=en|archive-date=November 4, 2021|archive-url=https://web.archive.org/web/20211104011324/https://www.tensorflow.org/lite|url-status=live}} These models are compressed and optimized in order to be more efficient and have a higher performance on smaller capacity devices.{{Cite web|title=TensorFlow Lite|url=https://www.tensorflow.org/lite/guide|access-date=November 1, 2021|website=TensorFlow|language=en|archive-date=November 2, 2021|archive-url=https://web.archive.org/web/20211102150551/https://www.tensorflow.org/lite/guide|url-status=live}}
LiteRT uses FlatBuffers as the data serialization format for network models, eschewing the Protocol Buffers format used by standard TensorFlow models.
= TFX =
TensorFlow Extended (abbrev. TFX) provides numerous components to perform all the operations needed for end-to-end production.{{Cite web|title=TensorFlow Extended (TFX) {{!}} ML Production Pipelines|url=https://www.tensorflow.org/tfx|access-date=November 2, 2021|website=TensorFlow|language=en|archive-date=November 4, 2021|archive-url=https://web.archive.org/web/20211104005652/https://www.tensorflow.org/tfx|url-status=live}} Components include loading, validating, and transforming data, tuning, training, and evaluating the machine learning model, and pushing the model itself into production.
= Integrations =
== Numpy ==
Numpy is one of the most popular Python data libraries, and TensorFlow offers integration and compatibility with its data structures.{{Cite web|title=Customization basics: tensors and operations {{!}} TensorFlow Core|url=https://www.tensorflow.org/tutorials/customization/basics|access-date=November 6, 2021|website=TensorFlow|language=en|archive-date=November 6, 2021|archive-url=https://web.archive.org/web/20211106055823/https://www.tensorflow.org/tutorials/customization/basics|url-status=live}} Numpy NDarrays, the library's native datatype, are automatically converted to TensorFlow Tensors in TF operations; the same is also true vice versa. 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.
= Extensions =
TensorFlow also offers a variety of libraries and extensions to advance and extend the models and methods used.{{Cite web|title=Guide {{!}} TensorFlow Core|url=https://www.tensorflow.org/guide|access-date=November 4, 2021|website=TensorFlow|language=en|archive-date=July 17, 2019|archive-url=https://web.archive.org/web/20190717021617/https://www.tensorflow.org/guide|url-status=live}} For example, TensorFlow Recommenders and TensorFlow Graphics are libraries for their respective functional.{{Cite web|title=Libraries & extensions|url=https://www.tensorflow.org/resources/libraries-extensions|access-date=November 4, 2021|website=TensorFlow|language=en|archive-date=November 4, 2021|archive-url=https://web.archive.org/web/20211104012048/https://www.tensorflow.org/resources/libraries-extensions|url-status=live}} Other add-ons, libraries, and frameworks include TensorFlow Model Optimization, TensorFlow Probability, TensorFlow Quantum, and TensorFlow Decision Forests.
== Google Colab ==
Google also released Colaboratory, a TensorFlow Jupyter notebook environment that does not require any setup.{{cite web|title=Colaboratory – Google|url=https://research.google.com/colaboratory/faq.html|access-date=November 10, 2018|website=research.google.com|language=en|archive-date=October 24, 2017|archive-url=https://web.archive.org/web/20171024191457/https://research.google.com/colaboratory/faq.html|url-status=live}} It runs on Google Cloud and allows users free access to GPUs and the ability to store and share notebooks on Google Drive.{{Cite web|title=Google Colaboratory|url=https://colab.research.google.com/|access-date=November 6, 2021|website=colab.research.google.com|language=en|archive-date=February 3, 2021|archive-url=https://web.archive.org/web/20210203141626/https://colab.research.google.com/|url-status=live}}
== Google JAX ==
{{main|Google JAX}}
Google JAX is a machine learning framework for transforming numerical functions.{{Citation |title=JAX: Autograd and XLA |date=June 18, 2022 |url=https://github.com/google/jax |archive-url=https://web.archive.org/web/20220618205214/https://github.com/google/jax |publisher=Google |bibcode=2021ascl.soft11002B |access-date=June 18, 2022 |archive-date=June 18, 2022|last1=Bradbury |first1=James |last2=Frostig |first2=Roy |last3=Hawkins |first3=Peter |last4=Johnson |first4=Matthew James |last5=Leary |first5=Chris |last6=MacLaurin |first6=Dougal |last7=Necula |first7=George |last8=Paszke |first8=Adam |last9=Vanderplas |first9=Jake |last10=Wanderman-Milne |first10=Skye |last11=Zhang |first11=Qiao |journal=Astrophysics Source Code Library}}{{Cite web |title=Using JAX to accelerate our research |url=https://www.deepmind.com/blog/using-jax-to-accelerate-our-research |url-status=live |archive-url=https://web.archive.org/web/20220618205746/https://www.deepmind.com/blog/using-jax-to-accelerate-our-research |archive-date=June 18, 2022 |access-date=June 18, 2022 |website=www.deepmind.com |language=en}}{{Cite web |date=April 25, 2022 |title=Why is Google's JAX so popular? |url=https://analyticsindiamag.com/why-is-googles-jax-so-popular/ |url-status=live |archive-url=https://web.archive.org/web/20220618210503/https://analyticsindiamag.com/why-is-googles-jax-so-popular/ |archive-date=June 18, 2022 |access-date=June 18, 2022 |website=Analytics India Magazine |language=en-US}} It is described as bringing together a modified version of [https://github.com/HIPS/autograd autograd] (automatic obtaining of the gradient function through differentiation of a function) and TensorFlow's [https://www.tensorflow.org/xla 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:
- grad: automatic differentiation
- jit: compilation
- vmap: auto-vectorization
- pmap: SPMD programming
Applications
= Medical =
GE Healthcare used TensorFlow to increase the speed and accuracy of MRIs in identifying specific body parts.{{Cite web|title=Intelligent Scanning Using Deep Learning for MRI|url=https://blog.tensorflow.org/2019/03/intelligent-scanning-using-deep-learning.html|access-date=November 4, 2021|language=en|archive-date=November 4, 2021|archive-url=https://web.archive.org/web/20211104183851/https://blog.tensorflow.org/2019/03/intelligent-scanning-using-deep-learning.html|url-status=live}} Google used TensorFlow to create DermAssist, a free mobile application that allows users to take pictures of their skin and identify potential health complications.{{Cite web|title=Case Studies and Mentions|url=https://www.tensorflow.org/about/case-studies|access-date=November 4, 2021|website=TensorFlow|language=en|archive-date=October 26, 2021|archive-url=https://web.archive.org/web/20211026011835/https://www.tensorflow.org/about/case-studies|url-status=live}} Sinovation Ventures used TensorFlow to identify and classify eye diseases from optical coherence tomography (OCT) scans.
= Social media =
Twitter implemented TensorFlow to rank tweets by importance for a given user, and changed their platform to show tweets in order of this ranking.{{Cite web|title=Ranking Tweets with TensorFlow|url=https://blog.tensorflow.org/2019/03/ranking-tweets-with-tensorflow.html|access-date=November 4, 2021|language=en|archive-date=November 4, 2021|archive-url=https://web.archive.org/web/20211104005536/https://blog.tensorflow.org/2019/03/ranking-tweets-with-tensorflow.html|url-status=live}} Previously, tweets were simply shown in reverse chronological order. The photo sharing app VSCO used TensorFlow to help suggest custom filters for photos.
= Search Engine =
Google officially released RankBrain on October 26, 2015, backed by TensorFlow.{{Cite web|last=Davies |first=Dave |title=A Complete Guide to the Google RankBrain Algorithm|url=https://www.searchenginejournal.com/google-algorithm-history/rankbrain/|access-date=October 15, 2024|website=Search Engine Journal|date=September 2, 2020|language=en|archive-date=November 6, 2021|archive-url=https://web.archive.org/web/20211106062307/https://www.searchenginejournal.com/google-algorithm-history/rankbrain/|url-status=live}}
= Education =
InSpace, a virtual learning platform, used TensorFlow to filter out toxic chat messages in classrooms.{{Cite web|title=InSpace: A new video conferencing platform that uses TensorFlow.js for toxicity filters in chat|url=https://blog.tensorflow.org/2020/12/inspace-new-video-conferencing-platform-uses-tensorflowjs-for-toxicity-filters-in-chat.html|access-date=November 4, 2021|language=en|archive-date=November 4, 2021|archive-url=https://web.archive.org/web/20211104005535/https://blog.tensorflow.org/2020/12/inspace-new-video-conferencing-platform-uses-tensorflowjs-for-toxicity-filters-in-chat.html|url-status=live}} Liulishuo, an online English learning platform, utilized TensorFlow to create an adaptive curriculum for each student.{{Cite web|last=Xulin|title=流利说基于 TensorFlow 的自适应系统实践|url=http://mp.weixin.qq.com/s?__biz=MzI0NjIzNDkwOA==&mid=2247484035&idx=1&sn=85fa0decac95e359435f68c50865ac0b&chksm=e94328f0de34a1e665e0d809b938efb34f0aa6034391891246fc223b7782ac3bfd6ddd588aa2#rd|access-date=November 4, 2021|website=Weixin Official Accounts Platform|archive-date=November 6, 2021|archive-url=https://web.archive.org/web/20211106224313/https://mp.weixin.qq.com/s?__biz=MzI0NjIzNDkwOA==&mid=2247484035&idx=1&sn=85fa0decac95e359435f68c50865ac0b&chksm=e94328f0de34a1e665e0d809b938efb34f0aa6034391891246fc223b7782ac3bfd6ddd588aa2#rd|url-status=live}} 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.
= Retail =
The e-commerce platform Carousell used TensorFlow to provide personalized recommendations for customers. The cosmetics company ModiFace used TensorFlow to create an augmented reality experience for customers to test various shades of make-up on their face.{{Cite web|title=How Modiface utilized TensorFlow.js in production for AR makeup try on in the browser|url=https://blog.tensorflow.org/2020/02/how-modiface-utilized-tensorflowjs-in-ar-makeup-in-browser.html|access-date=November 4, 2021|language=en|archive-date=November 4, 2021|archive-url=https://web.archive.org/web/20211104005535/https://blog.tensorflow.org/2020/02/how-modiface-utilized-tensorflowjs-in-ar-makeup-in-browser.html|url-status=live}}
{{multiple image
| footer= 2016 comparison of original photo (left) and with TensorFlow neural style applied (right)
| width= 150
| image1= TorontoMusicGarden10.jpg
| image2= TorontoMusicGarden10-TensorFlow2.jpg
}}
= Research =
TensorFlow is the foundation for the automated image-captioning software DeepDream.{{cite web |last1=Byrne |first1=Michael |title=Google Offers Up Its Entire Machine Learning Library as Open-Source Software |url=https://www.vice.com/en/article/google-offers-up-its-entire-machine-learning-library-as-open-source/ |website=Vice |access-date=November 11, 2015 |date=November 11, 2015 |archive-date=January 25, 2021 |archive-url=https://web.archive.org/web/20210125121138/https://www.vice.com/en/article/8q8avx/google-offers-up-its-entire-machine-learning-library-as-open-source |url-status=live}}
{{-}}
See also
{{Portal|Free and open-source software
}}
References
{{Reflist}}
Further reading
{{Refbegin}}
- {{Cite book
|first1=Laurence
|last1=Moroney
|date=October 1, 2020
|title=AI and Machine Learning for Coders
|edition=1st
|publisher=O'Reilly Media
|page=365
|isbn=9781492078197
|url=https://www.oreilly.com/library/view/ai-and-machine/9781492078180/
|access-date=December 21, 2020
|archive-date=June 7, 2021
|archive-url=https://web.archive.org/web/20210607074743/https://www.oreilly.com/library/view/ai-and-machine/9781492078180/
|url-status=live
}}
- {{Cite book
|first1=Aurélien
|last1=Géron
|date=October 15, 2019
|title=Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow
|edition=2nd
|publisher=O'Reilly Media
|page=856
|isbn=9781492032632
|url=https://www.oreilly.com/library/view/hands-on-machine-learning/9781492032632/
|access-date=November 25, 2019
|archive-date=May 1, 2021
|archive-url=https://web.archive.org/web/20210501010926/https://www.oreilly.com/library/view/hands-on-machine-learning/9781492032632/
|url-status=live
}}
- {{Cite book
|first1=Bharath
|last1=Ramsundar
|first2=Reza Bosagh
|last2=Zadeh
|date=March 23, 2018
|title=TensorFlow for Deep Learning
|edition=1st
|publisher=O'Reilly Media
|page=256
|isbn=9781491980446
|url=https://www.oreilly.com/library/view/tensorflow-for-deep/9781491980446/
|access-date=November 25, 2019
|archive-date=June 7, 2021
|archive-url=https://web.archive.org/web/20210607150529/https://www.oreilly.com/library/view/tensorflow-for-deep/9781491980446/
|url-status=live
}}
- {{Cite book
|first1=Tom
|last1=Hope
|first2=Yehezkel S.
|last2=Resheff
|first3=Itay
|last3=Lieder
|date=August 27, 2017
|title=Learning TensorFlow: A Guide to Building Deep Learning Systems
|edition=1st
|publisher=O'Reilly Media
|page=242
|isbn=9781491978504
|url=https://www.oreilly.com/library/view/learning-tensorflow/9781491978504/
|access-date=November 25, 2019
|archive-date=March 8, 2021
|archive-url=https://web.archive.org/web/20210308153359/https://www.oreilly.com/library/view/learning-tensorflow/9781491978504/
|url-status=live
}}
- {{Cite book
| first1=Nishant
| last1=Shukla
| date=February 12, 2018
| title=Machine Learning with TensorFlow
| edition=1st
| publisher=Manning Publications
| page=272
| isbn=9781617293870
}}
{{Refend}}
External links
- {{Official website|www.tensorflow.org}}
- [https://www.oreilly.com/library/view/learning-tensorflowjs/9781492090786/ Learning TensorFlow.js Book (ENG)]
{{Google AI}}
{{Deep learning software}}
{{Differentiable computing}}
{{Google FOSS}}
Category:Deep learning software
Category:Free software programmed in C++
Category:Free software programmed in Python
Category:Free statistical software
Category:Open-source artificial intelligence
Category:Python (programming language) scientific libraries