A (non) technical introduction to TensorFlow




David Dornseifer

ICN Innovation Engineering

Agenda


  1. What is TensorFlow (tf) in ...
    • an non-technical way?
    • throug the eyes of an software engineer?
  2. Praktical Aspects
  3. Demo

What is Tensorflow?

(in general)

General Intro to tf



  • Machine Learning Framework
  • Developed by Google Brain team
  • OpenSource - create an open standard for ML
  • Flexible - from research to production

General Intro to tf



  • Covers all aspects from testing, training to production and serving of models
  • Portable, platform independent
  • Scaleable

What is Tensorflow?

(a little bit technical :) )

How is DeepLearning done? (nDim Matrices)

What is a Tensor?



  • n-dimensional array or list specified by rank:
    • 0: scalar
    • 1: vector
    • 2: matrix
    • 3: 3-tensor (cube of numbers)
  • Datatypes: float, double, int ... (specific)

How is DeepLearning done? (Forward Propagation)

What about the Flow?



  • Modelling the computations as nodes in a directed graph
  • Checking for dimensional fit - pushing tensors through the network

What about the Flow?



How is DeepLearning done? (Computations)

Computations?



  • Computations are nodes on the graph
  • calculations are hidden from 'description language'
  • Operations for different architectures (CPUs, GPUs)
  • Large set of kernel methods included

Now, what makes tf so special



  • Using grpc (protobuf) for communication between nodes
  • Makes parallel computations easy (GPUs, distributed)
  • Scalability in mind
  • Distributed calculations

What's included?



  • Graph View
  • TensorBoard includes:
    • Graph viewer
    • Log analyzer, see when numbers converge
    • ...
  • Serving mode:
    • Train and export model
    • Load model and bring it up as a service

What is tf suited best for?



  • All kind of Machine Learning applications (obviously)
  • Distributed Calculations e.g. ...
    • Mandelbrot
    • Partial differential equations
  • Massive parallelization (CUDA)

Practical Aspects

How and where can it be used?



  • Docker*
  • Local instance*


* with or without GPU support

Which Programming Languages are involved



  • C / C++ for the core
  • Python bindings for data scientists and ML (Google)
  • Counting on Open-Source community for other languages

Demo

Example Code

							
	import tensorflow as tf

	x = tf.constant(1.0, name='input')
	w = tf.Variable(0.8, name='weight')
	y = tf.mul(w, x, name='output')
	y_ = tf.constant(0.0, name='correct_value')
	loss = tf.pow(y - y_, 2, name='loss')
	train_step = tf.train.GradientDescentOptimizer(0.025).minimize(loss)

	for value in [x, w, y, y_, loss]:
	    tf.scalar_summary(value.op.name, value)

	summaries = tf.merge_all_summaries()
	sess = tf.Session()
	summary_writer = tf.train.SummaryWriter('log_simple_stats', sess.graph)

	sess.run(tf.initialize_all_variables())
	for i in range(100):
	    summary_writer.add_summary(sess.run(summaries), i)
	    sess.run(train_step)
		

Tensorboard

Resources


Thanks for the attention :)

Any questions?