Skip to Main Content
TensorFlow: Powerful Predictive Analytics with TensorFlow
book

TensorFlow: Powerful Predictive Analytics with TensorFlow

by Md. Rezaul Karim
March 2018
Intermediate to advanced content levelIntermediate to advanced
164 pages
3h 39m
English
Packt Publishing
Content preview from TensorFlow: Powerful Predictive Analytics with TensorFlow

TensorFlow Programming Model

The TensorFlow programming model signifies how to structure your predictive models. A TensorFlow program is generally divided into four phases once you have imported TensorFlow library for associated resources:

  • Construction of the computational graph that involves some operations on tensors (we will see what is a tensor soon)
  • Create a session
  • Running a session, that is performed for the operations defined in the graph
  • Computation for data collection and analysis

These main steps define the programming model in TensorFlow. Consider the following example, in which we want to multiply two numbers:

import tensorflow as tf x = tf.constant(8) y = tf.constant(9) z = tf.multiply(x, y) sess = tf.Session() out_z = sess.run(z) Finally, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

TensorFlow Machine Learning Projects

TensorFlow Machine Learning Projects

Ankit Jain, Dr. Amita Kapoor
Machine Learning Using TensorFlow Cookbook

Machine Learning Using TensorFlow Cookbook

Alexia Audevart, Konrad Banachewicz, Luca Massaron

Publisher Resources

ISBN: 9781789136913Supplemental Content