Reader small image

You're reading from  TensorFlow 2.0 Quick Start Guide

Product typeBook
Published inMar 2019
Reading LevelBeginner
PublisherPackt
ISBN-139781789530759
Edition1st Edition
Languages
Right arrow
Author (1)
Tony Holdroyd
Tony Holdroyd
author image
Tony Holdroyd

Tony Holdroyd's first degree, from Durham University, was in maths and physics. He also has technical qualifications, including MCSD, MCSD.net, and SCJP. He holds an MSc in computer science from London University. He was a senior lecturer in computer science and maths in further education, designing and delivering programming courses in many languages, including C, C+, Java, C#, and SQL. His passion for neural networks stems from research he did for his MSc thesis. He has developed numerous machine learning, neural network, and deep learning applications, and has advised in the media industry on deep learning as applied to image and music processing. Tony lives in Gravesend, Kent, UK, with his wife, Sue McCreeth, who is a renowned musician.
Read more about Tony Holdroyd

Right arrow

Preface

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

Who this book is for

As its title suggests, this book has been written to introduce readers to TensorFlow and many of its latest features, up to and including version 2.0.0 alpha, including eager execution, tf.data, tf.keras, TensorFlow Hub, machine learning, and neural network applications.

This book is intended to be useful for anyone with some exposure to machine learning and its applications: data scientists, machine learning engineers, computer scientists, computer science students, and hobbyists.

What this book covers

Chapter 1, Introducing TensorFlow 2, introduces TensorFlow by looking at a number of snippets of code, illustrating some basic operations. We will have an overview of the modern TensorFlow ecosystem and will see how to install TensorFlow.

Chapter 2, Keras, a High-Level API for TensorFlow 2, takes a look at the Keras API, including some general comments and insights, followed by a basic architecture expressed in four different ways, for training with the MNIST dataset.

Chapter 3, ANN Technologies Using TensorFlow 2, examines a number of technologies that support the creation and use of neural networks. This chapter will cover data presentation to an ANN, layers of an ANN, creating the model, gradient calculations for gradient descent algorithms, loss functions, and saving and restoring models.

Chapter 4, Supervised Machine Learning Using TensorFlow 2, describes examples of the use of TensorFlow for two situations involving linear regression where features are mapped to known labels that have continuous values, allowing predictions on unseen features to be made.

Chapter 5, Unsupervised Learning Using TensorFlow 2, looks at two applications of autoencoders in unsupervised learning: firstly for compressing data; and secondly, for denoising, in other words, removing noise from images.

Chapter 6, Recognizing Images with TensorFlow 2, firstly looks at the Google Quick Draw 1 image dataset, and secondly, at the CIFAR 10 image dataset.

Chapter 7, Neural Style Transfer Using TensorFlow 2, explains how to take a content image and a style image and then produce a hybrid image. We will use layers from the trained VGG19 model to accomplish this.

Chapter 8, Recurrent Neural Networks Using TensorFlow 2, initially discusses the general principles of RNNs and then looks at how to acquire and prepare some text for use by a model.

Chapter 9, TensorFlow Estimators and TensorFlow Hub, firstly looks at an estimator for training the fashion dataset. We will see how estimators provide a simple, intuitive API for TensorFlow. We will also look at a neural network for analyzing the film feedback database, IMDb.

Appendix, Converting from tf1.12 to tf2, contains some tips for converting your tf1.12 files to tf2.

To get the most out of this book

Working knowledge of Python 3.6 is assumed, as is familiarity with the use of Jupyter Notebooks.

The book is written assuming that readers are happier with explanations given in the form of code snippets and complete programs than long textual explanations, which, of course, have their place in different styles of book.

Some familiarity with machine learning concepts and techniques is highly recommended, although not absolutely essential if the reader is willing to do a little reading around on the subjects.

Download the example code files

You can download the example code files for this book from your account at www.packt.com. If you purchased this book elsewhere, you can visit www.packt.com/support and register to have the files emailed directly to you.

You can download the code files by following these steps:

  1. Log in or register at www.packt.com.
  2. Select the SUPPORT tab.
  3. Click on Code Downloads & Errata.
  4. Enter the name of the book in the Search box and follow the onscreen instructions.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR/7-Zip for Windows
  • Zipeg/iZip/UnRarX for Mac
  • 7-Zip/PeaZip for Linux

The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Tensorflow-2.0-Quick-Start-Guide. In case there's an update to the code, it will be updated on the existing GitHub repository.

We also have other code bundles from our rich catalogue of books and videos available at https://github.com/PacktPublishing/. Check them out!

Download the color images

Conventions used

There are a number of text conventions used throughout this book.

CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "Mount the downloaded WebStorm-10*.dmg disk image file as another disk in your system."

A block of code is set as follows:

image1 = tf.zeros([7, 28, 28, 3]) #  example-within-batch by height by width by color

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

r1 = tf.reshape(t2,[2,6]) # 2 rows 6 cols
r2 = tf.reshape(t2,[1,12]) # 1 rows 12 cols
r1
# <tf.Tensor: id=33, shape=(2, 6), dtype=float32,
numpy= array([[ 0., 1., 2., 3., 4., 5.], [ 6., 7., 8., 9., 10., 11.]], dtype=float32)>

Any command-line input or output is written as follows:

var = tf.Variable([3, 3])

Bold: Indicates a new term, an important word, or words that you see on screen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "Select System info from the Administration panel."

Warnings or important notes appear like this.
Tips and tricks appear like this.

Get in touch

Feedback from our readers is always welcome.

General feedback: If you have questions about any aspect of this book, mention the book title in the subject of your message and email us at customercare@packtpub.com.

Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packt.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details.

Piracy: If you come across any illegal copies of our works in any form on the internet, we would be grateful if you would provide us with the location address or website name. Please contact us at copyright@packt.com with a link to the material.

If you are interested in becoming an author: If there is a topic that you have expertise in, and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.

Reviews

Please leave a review. Once you have read and used this book, why not leave a review on the site that you purchased it from? Potential readers can then see and use your unbiased opinion to make purchase decisions, we at Packt can understand what you think about our products, and our authors can see your feedback on their book. Thank you!

For more information about Packt, please visit packt.com.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
TensorFlow 2.0 Quick Start Guide
Published in: Mar 2019Publisher: PacktISBN-13: 9781789530759
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Tony Holdroyd

Tony Holdroyd's first degree, from Durham University, was in maths and physics. He also has technical qualifications, including MCSD, MCSD.net, and SCJP. He holds an MSc in computer science from London University. He was a senior lecturer in computer science and maths in further education, designing and delivering programming courses in many languages, including C, C+, Java, C#, and SQL. His passion for neural networks stems from research he did for his MSc thesis. He has developed numerous machine learning, neural network, and deep learning applications, and has advised in the media industry on deep learning as applied to image and music processing. Tony lives in Gravesend, Kent, UK, with his wife, Sue McCreeth, who is a renowned musician.
Read more about Tony Holdroyd