TensorFlow 2.0 Quick Start Guide
eBook - ePub

TensorFlow 2.0 Quick Start Guide

Get up to speed with the newly introduced features of TensorFlow 2.0

Tony Holdroyd

  1. 196 Seiten
  2. English
  3. ePUB (handyfreundlich)
  4. Über iOS und Android verfügbar
eBook - ePub

TensorFlow 2.0 Quick Start Guide

Get up to speed with the newly introduced features of TensorFlow 2.0

Tony Holdroyd

Angaben zum Buch
Buchvorschau
Inhaltsverzeichnis
Quellenangaben

Über dieses Buch

Perform supervised and unsupervised machine learning and learn advanced techniques such as training neural networks.

Key Features

  • Train your own models for effective prediction, using high-level Keras API
  • Perform supervised and unsupervised machine learning and learn advanced techniques such as training neural networks
  • Get acquainted with some new practices introduced in TensorFlow 2.0 Alpha

Book Description

TensorFlow is one of the most popular machine learning frameworks in Python. With this book, you will improve your knowledge of some of the latest TensorFlow features and will be able to perform supervised and unsupervised machine learning and also train neural networks.

After giving you an overview of what's new in TensorFlow 2.0 Alpha, the book moves on to setting up your machine learning environment using the TensorFlow library. You will perform popular supervised machine learning tasks using techniques such as linear regression, logistic regression, and clustering.

You will get familiar with unsupervised learning for autoencoder applications. The book will also show you how to train effective neural networks using straightforward examples in a variety of different domains.

By the end of the book, you will have been exposed to a large variety of machine learning and neural network TensorFlow techniques.

What you will learn

  • Use tf.Keras for fast prototyping, building, and training deep learning neural network models
  • Easily convert your TensorFlow 1.12 applications to TensorFlow 2.0-compatible files
  • Use TensorFlow to tackle traditional supervised and unsupervised machine learning applications
  • Understand image recognition techniques using TensorFlow
  • Perform neural style transfer for image hybridization using a neural network
  • Code a recurrent neural network in TensorFlow to perform text-style generation

Who this book is for

Data scientists, machine learning developers, and deep learning enthusiasts looking to quickly get started with TensorFlow 2 will find this book useful. Some Python programming experience with version 3.6 or later, along with a familiarity with Jupyter notebooks will be an added advantage. Exposure to machine learning and neural network techniques would also be helpful.

Häufig gestellte Fragen

Wie kann ich mein Abo kündigen?
Gehe einfach zum Kontobereich in den Einstellungen und klicke auf „Abo kündigen“ – ganz einfach. Nachdem du gekündigt hast, bleibt deine Mitgliedschaft für den verbleibenden Abozeitraum, den du bereits bezahlt hast, aktiv. Mehr Informationen hier.
(Wie) Kann ich Bücher herunterladen?
Derzeit stehen all unsere auf Mobilgeräte reagierenden ePub-Bücher zum Download über die App zur Verfügung. Die meisten unserer PDFs stehen ebenfalls zum Download bereit; wir arbeiten daran, auch die übrigen PDFs zum Download anzubieten, bei denen dies aktuell noch nicht möglich ist. Weitere Informationen hier.
Welcher Unterschied besteht bei den Preisen zwischen den Aboplänen?
Mit beiden Aboplänen erhältst du vollen Zugang zur Bibliothek und allen Funktionen von Perlego. Die einzigen Unterschiede bestehen im Preis und dem Abozeitraum: Mit dem Jahresabo sparst du auf 12 Monate gerechnet im Vergleich zum Monatsabo rund 30 %.
Was ist Perlego?
Wir sind ein Online-Abodienst für Lehrbücher, bei dem du für weniger als den Preis eines einzelnen Buches pro Monat Zugang zu einer ganzen Online-Bibliothek erhältst. Mit über 1 Million Büchern zu über 1.000 verschiedenen Themen haben wir bestimmt alles, was du brauchst! Weitere Informationen hier.
Unterstützt Perlego Text-zu-Sprache?
Achte auf das Symbol zum Vorlesen in deinem nächsten Buch, um zu sehen, ob du es dir auch anhören kannst. Bei diesem Tool wird dir Text laut vorgelesen, wobei der Text beim Vorlesen auch grafisch hervorgehoben wird. Du kannst das Vorlesen jederzeit anhalten, beschleunigen und verlangsamen. Weitere Informationen hier.
Ist TensorFlow 2.0 Quick Start Guide als Online-PDF/ePub verfügbar?
Ja, du hast Zugang zu TensorFlow 2.0 Quick Start Guide von Tony Holdroyd im PDF- und/oder ePub-Format sowie zu anderen beliebten Büchern aus Computer Science & Neural Networks. Aus unserem Katalog stehen dir über 1 Million Bücher zur Verfügung.

Information

Jahr
2019
ISBN
9781789536966

Section 1: Introduction to TensorFlow 2.00 Alpha

In this section, we will introduce TensorFlow 2.00 alpha. We will begin with an overview of the major features of this machine learning ecosystem and see some examples of its use. We will then introduce TensorFlow's high-level Keras API. We will end the section with an investigation of artificial neural network technologies and techniques.
This section contains the following chapters:
  • Chapter 1, Introducing TensorFlow 2
  • Chapter 2, Keras, a High-Level API for TensorFlow 2
  • Chapter 3, ANN Technologies Using TensorFlow 2

Introducing TensorFlow 2

TensorFlow began its life in 2011 as DisBelief, an internal, closed source project at Google. DisBelief was a machine learning system that employed deep learning neural networks. This system morphed into TensorFlow, which was released to the developer community under an Apache 2.0 open source license, on November 9, 2015. Version 1.0.0 made its appearance on February 11, 2017. There have been a number of point releases since then that have incorporated a wealth of new features.
At the time of writing this book, the most recent version is TensorFlow 2.0.0 alpha release, which was announced at the TensorFlow Dev Summit on March 6, 2019.
TensorFlow takes its name from, well, tensors. A tensor is a generalization of vectors and matrices to possibly higher dimensions. The rank of a tensor is the number of indices it takes to uniquely specify each element of that tensor. A scalar (a simple number) is a tensor of rank 0, a vector is a tensor of rank 1, a matrix is a tensor of rank 2, and a 3-dimensional array is a tensor of rank 3. A tensor has a datatype and a shape (all of the data items in a tensor must have the same type). An example of a 4-dimensional tensor (that is, rank 4) is an image where the dimensions are an example within—batch, height, width, and color channel (for example):
image1 = tf.zeros([7, 28, 28, 3]) #  example-within-batch by height by width by color
Although TensorFlow can be leveraged for many areas of numerical computing in general, and machine learning in particular, its main area of research and development has been in the applications of Deep Neural Networks (DNN), where it has been used in diverse areas such as voice and sound recognition, for example, in the now widespread voice-activated assistants; text-based applications such as language translators; image recognition such as exo-planet hunting, cancer detection, and diagnosis; and time series applications such as recommendation systems.
In this chapter, we will discuss the following:
  • Looking at the modern TensorFlow ecosystem
  • Installing TensorFlow
  • Housekeeping and eager operations
  • Providing useful TensorFlow operations

Looking at the modern TensorFlow ecosystem

Let's discuss eager execution. The first incarnation of TensorFlow involved constructing a computational graph made up of operations and tensors, which had to be subsequently evaluated in what Google termed as session (this is known as declarative programming). This is still a common way to write TensorFlow programs. However, eager execution, available from release 1.5 onward in research form and baked into TensorFlow proper from release 1.7, involves the immediate evaluation of operations, with the consequence that tensors can be treated like NumPy arrays (this is known as imperative programming).
Google says that eager execution is the preferred method for research and development but that computational graphs are to be preferred for serving TensorFlow production applications.
tf.data is an API that allows you to build complicated data input pipelines from simpler, reusable parts. The highest level abstraction is Dataset, which comprises both elements of nested structures of tensors and a plan of transformations that are to act on those elements. There are classes for the following:
  • There's Dataset consisting of fixed length record sets from at least one binary file (FixedLengthRecordDataset)
  • There's Dataset consisting of records from at least one TFRecord file (TFRecordDataset)
  • There's Dataset consisting of records that are lines from at least one text file (TFRecordDataset)
  • There is also a class that represents the state of iterating through Dataset (tf.data.Iterator)
Let's move on to the estimator, which is a high-level API that allows you to build greatly simplified machine learning programs. Estimators take care of training, evaluation, prediction, and exports for serving.
TensorFlow.js is a collection of APIs that allow you to build and train models using either the low-level JavaScript linear algebra library or the high-level layers API. Hence, models can be trained and run in a browser.
TensorFlow Lite is a lightweight version of TensorFlow for mobile and embedded devices. It consists of a runtime interpreter and a set of utilities. The idea is that you train a model on a higher-powered machine and then convert your model into the .tflite format using the utilities. You then load the model into your device of choice. At the time of writing, TensorFlow Lite is supported on Android and iOS with a C++ API and has a Java wrapper for Android. If an Android device supports the Android Neural Networks (ANN) API for hardware acceleration, then the interpreter will use this, or else it will default to the CPU for execution.
TensorFlow Hub is a library designed to foster the publication, discovery, and use of reusable modules of machine learning models. In this context, a module is a self-contained piece of a TensorFlow graph together with its weights and other assets. The module can be reused in different tasks in a method known as transfer learning. The idea is that you t...

Inhaltsverzeichnis

  1. Title Page
  2. Copyright and Credits
  3. Dedication
  4. About Packt
  5. Contributors
  6. Preface
  7. Section 1: Introduction to TensorFlow 2.00 Alpha
  8. Introducing TensorFlow 2
  9. Keras, a High-Level API for TensorFlow 2
  10. ANN Technologies Using TensorFlow 2
  11. Section 2: Supervised and Unsupervised Learning in TensorFlow 2.00 Alpha
  12. Supervised Machine Learning Using TensorFlow 2
  13. Unsupervised Learning Using TensorFlow 2
  14. Section 3: Neural Network Applications of TensorFlow 2.00 Alpha
  15. Recognizing Images with TensorFlow 2
  16. Neural Style Transfer Using TensorFlow 2
  17. Recurrent Neural Networks Using TensorFlow 2
  18. TensorFlow Estimators and TensorFlow Hub
  19. Converting from tf1.12 to tf2
  20. Other Books You May Enjoy
Zitierstile für TensorFlow 2.0 Quick Start Guide

APA 6 Citation

Holdroyd, T. (2019). TensorFlow 2.0 Quick Start Guide (1st ed.). Packt Publishing. Retrieved from https://www.perlego.com/book/955583/tensorflow-20-quick-start-guide-get-up-to-speed-with-the-newly-introduced-features-of-tensorflow-20-pdf (Original work published 2019)

Chicago Citation

Holdroyd, Tony. (2019) 2019. TensorFlow 2.0 Quick Start Guide. 1st ed. Packt Publishing. https://www.perlego.com/book/955583/tensorflow-20-quick-start-guide-get-up-to-speed-with-the-newly-introduced-features-of-tensorflow-20-pdf.

Harvard Citation

Holdroyd, T. (2019) TensorFlow 2.0 Quick Start Guide. 1st edn. Packt Publishing. Available at: https://www.perlego.com/book/955583/tensorflow-20-quick-start-guide-get-up-to-speed-with-the-newly-introduced-features-of-tensorflow-20-pdf (Accessed: 14 October 2022).

MLA 7 Citation

Holdroyd, Tony. TensorFlow 2.0 Quick Start Guide. 1st ed. Packt Publishing, 2019. Web. 14 Oct. 2022.