Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Quick and Easy Tensorflow with AE5 | Michael Grant

243 views

Published on

AnacondaCON 2018

Published in: Data & Analytics
  • Be the first to comment

Quick and Easy Tensorflow with AE5 | Michael Grant

  1. 1. Quick and Easy TensorFlow with AE5 Michael C., Grant, Ph.D. Director, Technical Consulting, Anaconda Inc.
  2. 2. Michael C. Grant, Ph.D. Director, Technical Consulting Anaconda, Inc. About me • Computational mathematician • 3 years @ Anaconda • 15+ years: startups, consulting, research • Before Python: MATLAB, C/C++, VBA • That’s a borrowed chicken © 2018 Anaconda, Inc. All Rights Reserved. 2
  3. 3. • TensorFlow and Anaconda work well together Executive Summary © 2018 Anaconda, Inc. All Rights Reserved. 3
  4. 4. • TensorFlow and Anaconda work well together • Conda simplifies the installation & deployment of TF packages • Collaborative, cloud/cluster-based model development • One-click deployments notebooks, dashboards, REST APIs • No need to give up your existing data pipeline experience Executive Summary © 2018 Anaconda, Inc. All Rights Reserved. 4
  5. 5. • “... an open-source library for high performance numerical computation” • Primarily a tool for machine learning & AI applications • Low-level capabilities: • Tensor (n-d array) computation • Dataflow graphs for structured pipeline computation • Automatic differentiation • Distributed computation support, including GPUs & TPUs © 2018 Anaconda, Inc. All Rights Reserved. 5
  6. 6. • Visualize your TensorFlow compute graph • View plots of training progress, error, other model-specific data • Deployable as an Anaconda Enterprise Web App TensorBoard © 2018 Anaconda, Inc. All Rights Reserved. 6
  7. 7. • TensorFlow packages built by the Anaconda Distribution team • CPU and GPU versions available • conda package manager installs all necessary dependencies • Full support for conda environments • TensorBoard automatically installed alongside Tensorflow © 2018 Anaconda, Inc. All Rights Reserved. 7
  8. 8. • Collaborative data science platform for Python & R • Deployable in private datacenters, AWS, Azure, GCP • One-click deployment of notebooks, dashboards, REST APIs ... but can I use all my favorite Anaconda packages? yes • GPU support coming with 5.2.0 (Q2) © 2018 Anaconda, Inc. All Rights Reserved. 8
  9. 9. • Add TensorFlow to a new or existing project • Upload an Anaconda Project archive from a local machine • Copy and modify a TensorFlow-enabled demo project Getting Started with TF & AE © 2018 Anaconda, Inc. All Rights Reserved. 9
  10. 10. © 2018 Anaconda, Inc. All Rights Reserved. 10
  11. 11. © 2018 Anaconda, Inc. All Rights Reserved. 11
  12. 12. © 2018 Anaconda, Inc. All Rights Reserved. 12
  13. 13. © 2018 Anaconda, Inc. All Rights Reserved. 13
  14. 14. © 2018 Anaconda, Inc. All Rights Reserved. 14
  15. 15. © 2018 Anaconda, Inc. All Rights Reserved. 15
  16. 16. • Uses the pre-built TensorFlow ImageNet model • Simple Tornado web front end (Flask also available) Demo: Image classifier © 2018 Anaconda, Inc. All Rights Reserved. 16
  17. 17. © 2018 Anaconda, Inc. All Rights Reserved. 17
  18. 18. © 2018 Anaconda, Inc. All Rights Reserved. 18
  19. 19. © 2018 Anaconda, Inc. All Rights Reserved. 19
  20. 20. © 2018 Anaconda, Inc. All Rights Reserved. 20
  21. 21. © 2018 Anaconda, Inc. All Rights Reserved. 21
  22. 22. • Digit recognition using the popular MNIST dataset • Multiple models are trained and compared • TensorBoard deployed as a Web App to explore the results Demo: MNIST Tensorboard © 2018 Anaconda, Inc. All Rights Reserved. 22
  23. 23. © 2018 Anaconda, Inc. All Rights Reserved. 23
  24. 24. © 2018 Anaconda, Inc. All Rights Reserved. 24
  25. 25. © 2018 Anaconda, Inc. All Rights Reserved. 25
  26. 26. • TensorFlow’s tf.data API offers a rich set of blocks for complex input pipelines • Powerful! but overkill for many simpler tabular data pipelines • Fortunately, we can bring our own tools to the playground... TensorFlow “a la carte” © 2018 Anaconda, Inc. All Rights Reserved. 26 https://archive.ics.uci.edu/ml/datasets/Census+Income
  27. 27. • Reproduce the W&DL Tutorial from Tensorflow • Replace the TF data pipeline with Pandas & Intake • Run on Anaconda Enterprise • Model objective: predict household income >$50K from the Census Income dataset Demo: Wide & Deep Learning © 2018 Anaconda, Inc. All Rights Reserved. 27 https://archive.ics.uci.edu/ml/datasets/Census+Income
  28. 28. • Both linear (“wide”) and deep learning models have strengths & weaknesses • Wide & Deep learning combines both approaches into a single model Wide & Deep Learning © 2018 Anaconda, Inc. All Rights Reserved. 28 https://www.tensorflow.org/tutorials/wide_and_deep
  29. 29. • Lightweight plugins for data loaders • CSV, ODBC, Parquet, Postgres, Mongo, HBase... • Loads directly into Pandas DataFrames, NumPy Arrays, Dask distributed data structures • Combines with Conda to produce versionable, platform- independent “data packages” • Free, BSD 2-clause license Intake: a Python API for bulk data © 2018 Anaconda, Inc. All Rights Reserved. 29 https://github.com/ContinuumIO?q=intake
  30. 30. • Generate a TensorFlow “columnset” for each Pandas Series • String & categorical columns require special treatment • Categorical: indicator_column, embedding_column • Use pandas_input_fn to generate a Pandas-friendly input function Using TensorFlow with Pandas: key steps © 2018 Anaconda, Inc. All Rights Reserved. 30 https://github.com/ContinuumIO?q=intake
  31. 31. def input_function(df, which): y = df['income_bracket'] == '>50K' x = df.drop(['income_bracket'], axis=1) return tf.estimator.inputs.pandas_input_fn(x, y, batch_size=BATCH_SIZE, num_epochs=EPOCHS_PER_EVAL, shuffle=True, target_column='income_bracket') pandas_input_fn example © 2018 Anaconda, Inc. All Rights Reserved. 31 https://github.com/ContinuumIO?q=intake
  32. 32. © 2018 Anaconda, Inc. All Rights Reserved. 32
  33. 33. • Learn more about Anaconda Enterprise • Install TensorFlow from Anaconda Cloud • Grab the Wide & Deep Learning project: • https://anaconda.org/mcg/wide-and-deep Next Steps © 2018 Anaconda, Inc. All Rights Reserved. 33

×