Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Analyzing model performance using TensorFlow Pr...

Analyzing model performance using TensorFlow Profiler.

Ashwin Phadke

October 10, 2020
Tweet

More Decks by Ashwin Phadke

Other Decks in Technology

Transcript

  1. ANALYZING MODEL PERFORMANCE USING TENSORFLOW PROFILER - Ashwin Phadke AI

    and Deep learning Engineer | Mentor | Trainer
  2. FIRST UP CONSUL TANTS TENSORFLOW : INTROCUCTION AND BASICS We

    need some good libraries i.e. base code to do amazing operations of convolutions over image, videos etc. Developed by Google Brain team and released in 2015. Available as: • TensorFlow • TensorFlow Lite • TensorFlow JS • TensorRT (NVidia). The name TensorFlow derives from the operations that such neural networks perform on multidimensional data arrays, which are referred to as tensors. TensorFlow computations are expressed as stateful dataflow graphs. A familiar dataflow programming language example can be VHDL. You can do following : • Preprocessing • Building models. • Evaluate , test and deploy models to production. 2
  3. FIRST UP CONSUL TANTS OVERVIEW OF TENSORFLOW AND IT’S FUNCTIONS

    Here we look at what some basic and common functions and operations mean while using TensorFlow Tensor : • A tensor is a vector or matrix of n-dimensions that represents all types of data. • Kind of np.arrays(). • They have identical data type and shape is the shape of the array. Graph : • In TensorFlow, all the operations are conducted inside a graph. The graph is a set of computation that takes place successively. Each operation is called an op node and are connected to each other. • The graph outlines the ops and connections between the nodes • All the computations in the graph are done by connecting tensors togetherA tensor has a node and an edge. • The node carries the mathematical operation and produces an endpoints outputs. • The edges explain the input/output relationships between nodes. 3 - Guru99
  4. FIRST UP CONSUL TANTS EXAMPLE USAGE Here is an example

    of how a tensor is initialized and how various operations are done on the defined tensors 4 - TensorFlow documentation
  5. FIRST UP CONSUL TANTS WHY PROFILE? Let’s check out why

    it is important for a ML workflow. • Performance is a key consideration for solutions. • Faster model training leads to faster iterations and reduced overhead. • To make a particular ML solution feasible. • However, it is not always clear what should be optimized. • Is there an issue with a specific operation (op), or the input pipeline? [TF Blog]
  6. FIRST UP CONSUL TANTS TENSORFLOW PROFILER The TensorFlow Profiler (or

    the Profiler) provides a set of tools that you can use to measure the training performance and resource consumption of your TensorFlow models. This new version of the Profiler is integrated into TensorBoard, and builds upon existing capabilities such as the Trace Viewer. [TF Blog]
  7. FIRST UP CONSUL TANTS WHAT YOU GET : Here’s an

    overview. CPU – GPU and TPU Overview Page • Provides a top-level view of model performance and recommendations to optimize it. Input Pipeline Analyzer • Analyzes your model’s data input pipeline for bottlenecks and recommends improvements to improve performance. TensorFlow Stats • Displays performance statistics for every TensorFlow operation executed during the profiling session. GPU Kernel Stats • Displays performance statistics and the originating operation for every GPU accelerated kernel.
  8. FIRST UP CONSUL TANTS CHANGES IN PERFORMANCE FOR TYPE OF

    IMPROVEMENT USED. Reference :https://www.kdnuggets.com/2020/03/tensorflow-optimizing-training-time-performance.html
  9. FIRST UP CONSUL TANTS SOME HANDS ON Alright! Get your

    laptops out and be quick. Colab Notebook: - Simple example - Tensorflow Profiler with Keras callback on a standard dataset. - Colab notebook 12
  10. FIRST UP CONSUL TANTS 13 Machine Learning Deep Learning Computer

    Vision NLP Credits to all Github awesome lists makers
  11. FIRST UP CONSUL TANTS REFERENCES : Here are references that

    helped me a lot and you should give it a try if I may suggest. • Deep Learning book : https://deeplearningbook.org, Goodfellow et.al * • Tensorflow Documentation. • TF dev summit TF profiler and TF data recordings on YouTube. • https://machinelearningmastery.com/ • Andrej Karpathy’s blog : http://karpathy.github.io/ • Coursera : Neural networks, Introduction to Tensorflow, Laurence Moroney • People to follow on LinkedIn : Dat Tran, Jason Mayes, Yogesh Kulkarni, Rahee Agate- Walambe, Usha Rangarajan, Laurence Moroney • PowerPoint Template : PowerPoint template store. • Google images and GIF search. 14