Building TensorFlow Systems from Components

Thank you!

planspace.org

@planarrowspace

Deep Learning Analytics

$ pip install --upgrade tensorflow
$ pip freeze | grep tensorflow
## tensorflow==1.1.0

Hello, TensorFlow! on O'Reilly

one third

$ pip install --upgrade tensorflow
$ pip freeze | grep tensorflow
## tensorflow==1.1.0

THE BIG IDEA

use what you need

THE PLAN

Do what you want!

Intro by Logo

LOGO turle

Gödel, Escher, Bach

Chernin Entertainment

TensorFlow logo - old?

Issue 1922

TensorFlow logo - new?

short work

draw a system!

short work over

Let's do hard AI!

(build)

system

What even is TensorFlow?

TensorFlow three-tier diagram

Python programming language

R programming language

C programming language

C++ programming language

Java programming language

Go programming language

Rust programming language

Haskell programming language

TensorFlow three-tier diagram

graph or not graph?

(notebook)

long work

work with data!

long work over

data

command-line arguments

$ python script.py --color red
a red flower
import sys

def main():
    assert sys.argv[1] == '--color'
    print('a {} flower'.format(sys.argv[2]))

if __name__ == '__main__':
    main()
import sys
import tensorflow as tf

flags = tf.app.flags
flags.DEFINE_string(flag_name='color',
                    default_value='green',
                    docstring='the color to make a flower')

def main():
    flags.FLAGS._parse_flags(args=sys.argv[1:])
    print('a {} flower'.format(flags.FLAGS.color))

if __name__ == '__main__':
    main()
import sys
import gflags

gflags.DEFINE_string(name='color',
                     default='green',
                     help='the color to make a flower')

def main():
    gflags.FLAGS(sys.argv)
    print('a {} flower'.format(gflags.FLAGS.color))

if __name__ == '__main__':
    main()
import sys
import argparse

parser = argparse.ArgumentParser()
parser.add_argument('--color',
                    default='green',
                    help='the color to make a flower')

def main():
    args = parser.parse_args(sys.argv[1:])
    print('a {} flower'.format(args.color))

if __name__ == '__main__':
    main()
import tensorflow as tf

def main(args):
    assert args[1] == '--color'
    print('a {} flower'.format(args[2]))

if __name__ == '__main__':
    tf.app.run()
import tensorflow as tf

flags = tf.app.flags
flags.DEFINE_string(flag_name='color',
                    default_value='green',
                    docstring='the color to make a flower')

def main(args):
    print('a {} flower'.format(flags.FLAGS.color))

if __name__ == '__main__':
    tf.app.run()
import google.apputils.app
import gflags

gflags.DEFINE_string(name='color',
                     default='green',
                     help='the color to make a flower')

def main(args):
    print('a {} flower'.format(gflags.FLAGS.color))

if __name__ == '__main__':
    google.apputils.app.run()
import argparse

parser = argparse.ArgumentParser()
parser.add_argument('--color',
                    default='green',
                    help='the color to make a flower')

def main():
    args = parser.parse_args()
    print('a {} flower'.format(args.color))

if __name__ == '__main__':
    main()

Whew!

MapReduce example

TensorFlow three-tier diagram

tf.device()

with tf.device('/cpu:0'):
    # Do something.
with tf.device('/gpu:0'):
    # Do something.
with tf.device('/job:ps/task:0'):
    # Do something.

distributing a TensorFlow graph

oh map reduce...

(demo)

(code)

long work

make something happen!

long work over

oh kubernetes...

TensorFlow six-tier diagram

slim... shady?

scikit-learn logo

Keras

(notebook)

graph

steps per second

loss

Doctor Strangelog

long work

make something happen!

long work over

shock

What else?

debugging, optimizing (XLA, low-precision, etc.), serving, building custom network architectures, embeddings, recurrent, generative, bazel, protobuf, gRPC, queues, threading...

Thanks!

planspace.org

@planarrowspace