1 of 17

TensorFlow and its ecosystem

AI Day Rome (September 13)

Simone Scardapane

2 of 17

Something about myself

Research fellow @ Sapienza (deep learning)�Google Developer Expert in machine learning�Co-founder of Italian Association for Machine Learning

3 of 17

Training Phase

Answers

Data

Rules

Machine Learning

Model

Data

Predictions

Inference Phase

4 of 17

5 of 17

2010

2013

2014

2015

2016

2018

2017

...

The evolution of DL frameworks

6 of 17

Source: Deep Learning Framework Power Scores 2018 (Towards Data Science)

7 of 17

17.5M

39000

Downloads

Commits

1600

11500

Contributors

Issues Responded

8 of 17

Brief intro to TF

9 of 17

x = tf.placeholder(tf.float32, [None, 200])

W = tf.Variable(tf.zeros([200, 10]))

b = tf.Variable(tf.zeros([10]))

y = tf.nn.softmax(tf.matmul(x, W) + b)

with tf.Session() as sess:

sess.run(tf.initialize_all_variables())

tf.train.start_queue_runners(sess)

example_batch = tf.train.batch([x], batch_size=10, num_threads=4, capacity=10)

max_steps = 1000

for step in range(max_steps):

x_in = sess.run(example_batch)

sess.run(train_step, feed_dict={x: train_data, y_: train_labels})

if (step % 100) == 0:

print(step, sess.run(accuracy, feed_dict={x: test_data, y_: test_labels}))

10 of 17

TensorFlow has grown impressively

11 of 17

TensorFlow Distributed Execution Engine

CPU

GPU

TPU

Mobile

Embedded

Neural Nets

C++

K-Means

Loss Functions, Metrics

Linear Algebra

Decision Trees

SVM

Gaussian Mixture Models

Regression

Random Forests

Probabilistic Methods

Signal Processing

Lattice

TensorFlow is a comprehensive ML framework

Python

Java

Javascript

12 of 17

Training + deployment

13 of 17

TensorFlow 2.0 focuses on:

  • Simple design of models (eager execution);
  • Seamless acceleration (tf.function);
  • Integration with internal and external components (tf.datasets, tf.hub, …);
  • Distributed optimization and more.

14 of 17

An example with text embedding

import tensorflow_hub as hub�embedder = hub.Module("https://tfhub.dev/google/universal-sentence-encoder/2")��embed = embedder(["How you doin'?"]) # [1, 512] vector of float32 values

15 of 17

Cloud capabilities and enhancements

16 of 17

Notebook time!

17 of 17

Thanks for listening! :-)�Shameful ad: http://iaml.it/member