A Journey of Learning TensorFlow

Today, I started reading TensorFlow (TF) and also decided to make notes and capture observations during this process. I have done programming for several years and did scripting in VB and Python as well so I will try to relate this new learning to my existing knowledge. This post and subsequent posts will help people with a similar background to learn it faster.

The lowest level API provided by TensorFlow is “Core”

The method names of high-level API starting from “contrib” are still in development phase and can be change or obsolete in future releases of TensorFlow.

Unit of data in TF is tensor

Tensor’s rank represents the dimensions of the array it has.

Core Program:

First, we create build the computational graph and then we run it in a session to see the values. (Looks like compile and run in conventional programming sense)

There are contents, variables, and operations in TF.

TensorBoard provides a graphical representation of computation graph. (like a data flow diagram in conventional programming sense)

Placeholders: Are like arguments for a method, that can be passed later to the program to utilize.

global_variables_initializer(): Interestingly there is a method in TF that initiate all variable being used in the model.

loss: Loss function tells difference between the model output and data provided. We use Standard Loss Function but there can be others as well.

The whole objective is to allow TF to minimize the best output that has minim loss value. Finding the best variable that constitutes the minimum loss is done through the Optimizers.

  • Simplest Optimizer is Gradient Descent.

tf.learn API is to Manage:

  • data sets
  • estimations
  • training
  • Inference (evaluations)


It simplifies the mechanics of machine learning. and do the following operations:

  • Run training loops
  • Run evaluation loops
  • Managing datasets
  • Managing Feeds.

In TF we usually use the existing models such as Linear Regression, however, its possible to write your own custom model that works differently.

For that you need to write “model” function following the protocol of tensor flow (like input variables and return value and type) and your calling method would be different.

Some more observations:

  • We used numpy library to build input for the TF model.
  • TF works only with Python 3.5
  • Pything 3.5 is available for Windows 64 bit so my plan of using a VM with 32 bit windows was not possible.
  • ArcGIS is comes with Pythin 2.7 and I don’t want to disturb that compatibility, so I did not try to install Python 3.5 on the same machine.
  • Seems that getting started and MNIST is not written by the same person. Therefore the flow of content is not very smooth. Some information is repetitive and not align well.










Leave a Reply