TensorFlow 2.0 Overview - For TensorFlow User Group by Ehsan Amjadian. Presented at TensorFlow for Banking & Financial Services meetup by TFUG on 22nd May, 2019.
TensorFlow 2.0 Overview - For TensorFlow User Group - Ehsan Amjadian
1. STRICTLY PRIVATE & CONFIDENTIAL | RBC Royal Bank of Canada | May 31, 2019 | 1
TensorFlow 2.0
Speaker: Ehsan Amjadian | Senior Data Scientist | DNA Geolocation Intelligence Team
Head of Research @ AISC
2. STRICTLY PRIVATE & CONFIDENTIAL | RBC Royal Bank of Canada | May 31, 2019 | 2
TF 2.0 Overview
3. STRICTLY PRIVATE & CONFIDENTIAL | RBC Royal Bank of Canada | May 31, 2019 | 3
Multiple API Levels
4. STRICTLY PRIVATE & CONFIDENTIAL | RBC Royal Bank of Canada | May 31, 2019 | 4
Main Upgrades
1. Eager Execution
2. Ease of Debugging and Imperative Programming for Experimentation
3. Aggressive Cleanup of all the synonymous APIs and many MANY boilerplates
• tf.flags, tf.logging replaced by absl-py
4. Making API’s more consistent: Unified RNNs, Unified Optimizers
5. Removal of queue runners in favor of tf.data
5. STRICTLY PRIVATE & CONFIDENTIAL | RBC Royal Bank of Canada | May 31, 2019 | 5
Even More
1. Syntax Tree
• User manually creates a abstract syntax tree using tf.* when passing tensors to
session.run
• TF 2 runs the code in order: Pythonic
2. Removal of Globals
• Variables added to graph at the time of creation and would only be retrieved by
their names, even if no pointers anymore.
• (Variables 2.0 RFC) removes such and adds garbage collection
3. Functions no Sessions:
• Node Pruning
• Kernel Fusion
6. STRICTLY PRIVATE & CONFIDENTIAL | RBC Royal Bank of Canada | May 31, 2019 | 6
AutoGraph
• Imperative Dev. With Autograph:
7. STRICTLY PRIVATE & CONFIDENTIAL | RBC Royal Bank of Canada | May 31, 2019 | 7
But my Graph Advantages?
• Advantages of the TF Computation Graph:
• Performance Opt.
• Remote Execution and Serializability
• Easily Export and Deploy
• In TF2.0 you can develop in Eager mode and translate your program to a graph using tf.function
8. STRICTLY PRIVATE & CONFIDENTIAL | RBC Royal Bank of Canada | May 31, 2019 | 8
Keras Variables and Trainable Variables
9. STRICTLY PRIVATE & CONFIDENTIAL | RBC Royal Bank of Canada | May 31, 2019 | 9
Distribution Strategy API & Unified SavedModel And
Deployment
• Dist. And train models on multiple architectures: CPUs, GPUs, TPUs.
• Model Serving unified across:
• TensorFlow Serving: HTTP/REST
• TensorFlow Lite: Mobile and Edge RasPi, iOS etc.
• TensorFlow.js: embedded web dep.
• TensorFlow Hub: enabling transfer learning
10. STRICTLY PRIVATE & CONFIDENTIAL | RBC Royal Bank of Canada | May 31, 2019 | 10
Thank you