Reader small image

You're reading from  Hands-On Neural Networks with TensorFlow 2.0

Product typeBook
Published inSep 2019
Reading LevelExpert
PublisherPackt
ISBN-139781789615555
Edition1st Edition
Languages
Right arrow
Author (1)
Paolo Galeone
Paolo Galeone
author image
Paolo Galeone

Paolo Galeone is a computer engineer with strong practical experience. After getting his MSc degree, he joined the Computer Vision Laboratory at the University of Bologna, Italy, as a research fellow, where he improved his computer vision and machine learning knowledge working on a broad range of research topics. Currently, he leads the Computer Vision and Machine Learning laboratory at ZURU Tech, Italy. In 2019, Google recognized his expertise by awarding him the title of Google Developer Expert (GDE) in Machine Learning. As a GDE, he shares his passion for machine learning and the TensorFlow framework by blogging, speaking at conferences, contributing to open-source projects, and answering questions on Stack Overflow.
Read more about Paolo Galeone

Right arrow

Preface

Technology leaders are adopting neural networks to enhance their products, making them smarter or, in marketing words, AI-powered. This book is a handy guide to TensorFlow, its inner structure, the new features of version 2.0 and how to use them to create neural-networks-based applications. By the end of this book, you will be well-versed in the TensorFlow architecture and its new features. You will be able to solve machine learning problems easily, using the power of neural networks.

This book starts with a theoretical overview of machine learning and neural networks, followed by a description of the TensorFlow library, in both its 1.x and 2.0 versions. Reading this book, you will become well-versed in the required theory for understanding how neural networks work, using easy-to-follow examples. Next, you will learn how to master optimization techniques and algorithms to build a wide range of neural network architectures using the new modules offered by TensorFlow 2.0. Furthermore, after having analyzed the TensorFlow structure, you will learn how to implement more complex neural network architectures such as CNNs for classification, semantic segmentation networks, generative adversarial networks, and others in your research work and projects.

By the end of this book, you will master the TensorFlow structure and will be able to leverage the power of this machine learning framework to train and use neural networks of varying complexities without much effort.

Who this book is for

This book is meant for data scientists, machine learning developers, deep learning researchers, and developers with a basic statistical background who want to work with neural networks and discover the TensorFlow structure and its new features. A working knowledge of the Python programming language is required to get the most out of the book.

What this book covers

Chapter 1, What is Machine Learning?, covers the fundamentals of machine learning: what supervised, unsupervised, and semi-supervised learning is and why these distinctions are important. Moreover, you will start to understand how to create a data pipeline, how to measure the performance of an algorithm, and how to validate your results.

Chapter 2, Neural Networks and Deep Learning, focuses on neural networks. You will learn about the strengths of machine learning models, how it is possible to make a network learn, and how, in practice, the model parameter update is performed. By the end of this chapter, you will understand the intuition behind backpropagation and network parameter updates. Moreover, you'll learn why deep neural network architectures are required to solve challenging tasks.

Chapter 3, TensorFlow Graph Architecture, covers the structure of TensorFlow – the structure that's shared between the 1.x and 2.x versions.

Chapter 4, TensorFlow 2.0 Architecture, demonstrates the difference between TensorFlow 1.x and TensorFlow 2.x. You'll start to develop some simple machine learning models using both these versions. You will also gain an understanding of all the common features of the two versions.

Chapter 5, Efficient Data Input Pipelines and Estimator API, shows how to define a complete data input pipeline using the tf.data API together with the use of the tf.estimator API to define experiments. By the end of this chapter, you'll be able to create complex and highly efficient input pipelines leveraging all the power of the tf.data and tf.io.gfile APIs.

Chapter 6, Image Classification Using TensorFlow Hub, covers how to use TensorFlow Hub to do transfer learning and fine-tuning easily by leveraging its tight integration with the Keras API.

Chapter 7, Introduction to Object Detection, shows how to extend your classifier, making it an object detector that regresses the coordinates of a bounding box, and also gives you an introduction to more complex object detection architectures.

Chapter 8, Semantic Segmentation and Custom Dataset Builder, covers how to implement a semantic segmentation network, how to prepare a dataset for this kind of task, and how to train and measure the performance of a model. You will solve a semantic segmentation problem using U-Net.

Chapter 9, Generative Adversarial Networks, covers GANs from a theoretical and practical point of view. You will gain an understanding of the structure of generative models and how the adversarial training can be easily implemented using TensorFlow 2.0.

Chapter 10, Bringing a Model to Production, shows how to go from a trained model to a complete application. This chapter also covers how to export a trained model to an indicated representation (SavedModel) and use it in a complete application. By the end of this chapter, you will be able to export a trained model and use it inside Python, TensorFlow.js, and also in Go using the tfgo library.

To get the most out of this book

You need to have a basic understanding of neural networks, but this is not mandatory since the topics will be covered from both a theoretical and a practical point of view. Working knowledge of basic machine learning algorithms is a plus. You need a good working knowledge of Python 3.

You should already know how to install packages using pip, how to set up your working environment to work with TensorFlow, and how to enable (if available) GPU acceleration. Moreover, a good background knowledge of programming concepts, such as imperative language versus descriptive language and object-oriented programming, is required.

The environment setup will be covered in Chapter 3, TensorFlow Graph Architecture, after the first two chapters on machine learning and neural network theory.

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.packtpub.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.
  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/Hands-On-Neural-Networks-with-TensorFlow-2.0. 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 catalog 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:

writer = tf.summary.FileWriter("log/two_graphs/g1", g1)
writer = tf.summary.FileWriter("log/two_graphs/g2", g2)
writer.close()

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

# create the virtualenv in the current folder (tf2)
pipenv --python 3.7
# run a new shell that uses the just created virtualenv
pipenv shell
# install, in the current virtualenv, tensorflow
pip install tensorflow==2.0
#or for GPU support: pip install tensorflow-gpu==2.0

Bold: Indicates a new term, an important word, or words that you see onscreen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "The second peculiarity of the tf.Graph structure is its graph collections."

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
Hands-On Neural Networks with TensorFlow 2.0
Published in: Sep 2019Publisher: PacktISBN-13: 9781789615555
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
Paolo Galeone

Paolo Galeone is a computer engineer with strong practical experience. After getting his MSc degree, he joined the Computer Vision Laboratory at the University of Bologna, Italy, as a research fellow, where he improved his computer vision and machine learning knowledge working on a broad range of research topics. Currently, he leads the Computer Vision and Machine Learning laboratory at ZURU Tech, Italy. In 2019, Google recognized his expertise by awarding him the title of Google Developer Expert (GDE) in Machine Learning. As a GDE, he shares his passion for machine learning and the TensorFlow framework by blogging, speaking at conferences, contributing to open-source projects, and answering questions on Stack Overflow.
Read more about Paolo Galeone