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

TensorFlow Estimators and TensorFlow Hub

This chapter is divided into two sections, but the technologies here are related. First, we will look at how TensorFlow Estimators provide a simple, high-level API for TensorFlow, and secondly, we will look at how TensorFlow Hub contains modules that we can make use of in our own applications.

In this chapter, we will cover the following main topics:

  • TensorFlow Estimators
  • TensorFlow Hub

TensorFlow Estimators

tf.estimator is a high-level API for TensorFlow. It is used to simplify machine learning programming by providing the means for the straightforward training, evaluation, predicting, and exporting of models for serving.

Estimators confer many advantages on the TensorFlow developer. It is easier and more intuitive to develop models with Estimators than with low-level APIs. In particular, the same model can be run on a local machine or on a distributed multi-server system. The model is also agnostic to the processor it finds itself on, that is, either CPUs, GPUs, or TPUs. Estimators also simplify the development process by making it easier for model developers to share implementations and, being built on Keras layers, make customization simpler.

Estimators take care of all of the background plumbing that goes into working with a TensorFlow model. They support...

TensorFlow Hub

TensorFlow Hub is a software library. Its purpose is to provide reusable components, known as modules, that can be leveraged in contexts other than the original context in which they were developed. By a module, we mean a self-contained piece of a TensorFlow graph, along with its weights, which can be reused across other, similar tasks.

IMDb (database of movie reviews)

In this section, we will examine an application based on one from Google that analyzes a subset of the IMDb of movie reviews in what is termed sentiment analysis. The subset is hosted by Stanford and contains reviews of each movie, together with a sentiment on a positivity scale of 1 to 4 (bad) and 7 to 10 (good). The problem is determining the...

Summary

In this chapter, we looked at an Estimator for training the fashion dataset. We saw how Estimators provide a simple, intuitive API for TensorFlow.

We then looked at another application, this time for the sentiment classification of reviews of movies in the IMDb. We saw how TensorFlow Hub provides us with text embeddings, that is, vectors for words, which is where words with similar meanings have similar vectors.

In this book, we have seen an overview of TensorFlow 2.0 alpha.

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