SlideShare a Scribd company logo
1 of 35
Download to read offline
Machine Learning at
scale with GCP
using ML Engine & Python Dataflow
19/09/2017
Matthias Feys
2
About ML6/Datatonic
We are a team of data scientists, machine learning
experts, software engineers and mathematicians.
Our mission is to provide tailor-made systems to help
your organization get smart actionable insights from
large data volumes.
+ Specialized Machine Learning partner of Google
Cloud
Matthias Feys
GDE for ML and GCP
@FsMatt - matthiasfeys@gmail.com
3 Outline
Dissecting a Machine Learning Project
Mapping the components to GCP tools
Building a boilerplate example
1
2
3
4
Opinionated view
Focus on tooling
not complete overview
no focus on models
no focus business
Caveats
5 Outline
Dissecting a Machine Learning Project
Mapping the components to GCP tools
Building a boilerplate example
1
2
3
6 Popular image of what ML is
Lots of data Magical resultsComplex mathematics in multidimensional spaces
7 In reality, ML is
Collect
data
Create
model
Train model with
organized data
Organize
data
Deploy trained
model
iterate
8 Concrete use case: predict stellar masses*
*data and problem of the 1st
DSGhent hackathon: https://astrohack.org
Predict stellar mass based
on:
● image of galaxy
● distance to galaxy
9 Collect & organize data
Input:
76k labelled galaxies:
● 1 grayscale image in different CSV files
● all distances to galaxies & actual masses in
single CSV file
Output:
Training, validation & test examples:
● Features:
○ normalized image (matrix of
predefined shape)
○ distance & derived features
● Label:
○ actual mass
10 Create & train model
Input:
Training, validation & test examples
Process:
● build model that predicts labels based on
features,
● fit model on training data,
● tune hyperparameters
● iterate
Output:
Best model fitted on the training data with
optimal hyperparameters
11 Deploy trained model
Input:
Best model fitted on the training data with
optimal hyperparameters
Output:
API that accepts input data for a single galaxy:
● 1 grayscale image
● distance to galaxy
and returns the predicted stellar mass
12 Outline
Dissecting a Machine Learning Project
Mapping the components to GCP tools
Building a boilerplate example
1
2
3
13 Google Cloud Products
Compute Storage
Data &
Analytics
Machine
Learning
14 GCP: Open Cloud Philosophy
● Powerful Open Source Frameworks that run everywhere
● Fully Managed Services to run it more easily
Cloud Machine
Learning Engine
TensorFlow
Cloud
Dataflow
Apache
Beam
15 Mapping to GCP Products
Collect
data
Create
model
Train model with
organized data
Organize
data
Deploy trained
model
Cloud Machine
Learning Engine
Cloud
Dataflow
Cloud Machine
Learning Engine
Cloud
Storage
Tensorflow
16 Datalab/Jupyter notebooks to experiment & iterate
Collect
data
Create
model
Train model with
organized data
Organize
data
Deploy trained
model
Iterate
17 Google Cloud Storage (GCS)
● Object Storage Service
● Your data lives here:
○ Raw input data
○ Cleaned examples for TF models
○ Serialized Tensorflow models
● Single interface/API, multiple
offerings
Name Access Frequency
Multi-Regional Frequent, Cross-regional
Regional Frequent, Single-region
Nearline Less than once per month
Coldline Less than once per year
18 Apache Beam running on Cloud Dataflow
● Open source, unified model for defining both
batch and streaming data-parallel processing
pipelines.
● Using one of the open source Beam SDKs, you
build a program that defines the pipeline.
● The pipeline is then executed by one of Beam’s
supported distributed processing back-ends,
which include Apache Apex, Apache Flink,
Apache Spark, and Google Cloud Dataflow.
Beam Model: Fn Runners
Apache
Flink
Apache
Spark
Beam Model: Pipeline
Construction
Other
LanguagesBeam Java
Beam
Python
Execution Execution
Cloud
Dataflow
Execution
Source: https://beam.apache.org
19 Apache Beam key concepts
● Pipelines: data processing job made of a
series of computations including input,
processing, and output
● PCollections: bounded (or unbounded)
datasets which represent the input,
intermediate and output data in pipelines
● PTransforms: data processing step in a
pipeline in which one or more PCollections are
an input and output
● I/O Sources and Sinks: APIs for reading and
writing data which are the roots and
endpoints of the pipeline.
Source: https://beam.apache.org
20 Apache Beam running on Cloud Dataflow
● Fully-managed data processing service
to run Apache Beam pipelines:
○ Automated and optimized
work partitioning which can
dynamically rebalance lagging work
○ Horizontal dynamic autoscaling of
worker resources
21 Collect & organize data with Cloud Dataflow
Astrohack use case steps:
● Read:
○ Metadata from 1 csv-file
○ Image data from 76k csv-files
● Combine datasets
● Preprocess and build Tensorflow
examples
● Split into train/validation/test set
● Write to TFRecords on GCS
22 Collect & organize data with Cloud Dataflow
1 1
2
2
3 3
4
4
5
5
23 Tensorflow
● Open-source library for machine learning
● Single API for multiple platforms/devices:
cpu(s), gpu(s),tpu(s), mobile phones...
● 2 step approach:
○ Construct your model as a
computational graph
○ Train your model by pushing data
through the graph
● Big community with lots of SotA model
implementations
24 ML Engine Training
● Tensorflow Training As a Service
● Data needs to be available online
● No fancy interface (only logging +
Tensorboard)
● Same code can run locally to test on small
datasets
● Nice features:
○ Easy setup of (GPU) clusters for
distributed Tensorflow models
○ Automatic parallel hyperparameter
tuning with Hypertune
25 ML Engine Training with contrib.learn and TFRecords on GCS
26 ML Engine Predictions
● Deploy trained model:
○ model (container)
○ version (actual code)
● Predictions:
○ batch
○ online
● Autoscaling
27 ML Engine Predictions
28 GCP components for ML summarized
Google Cloud Storage
● All your data lives here
● Very fast access from other GCP services
Cloud Dataflow
● Best place to run Apache Beam Pipelines
● Automatically & dynamically scales to 1000’s of cores
Cloud ML Engine
● Best place to train & deploy Tensorflow models
● Easy access to clusters of GPU machines to:
○ Train distributed model on multiple machines
○ Automate hyperparameter tuning (in parallel)
● Autoscales the number of serving nodes in response to request traffic
29 Outline
Dissecting a Machine Learning Project
Mapping the components to GCP tools
Building a boilerplate example
1
2
3
30 Boilerplate example
● Starterkit to deploy your Tensorflow project on Google Cloud Platform
● Structure based on the ML Engine samples, simplified
● Usage:
○ build locally on a sample on the dataset (faster for small datasets)
○ run in the cloud on the complete dataset (faster for large datasets)
● Functionalities:
○ preprocess data with Apache Beam (make TFRecords)
○ train Tensorflow model
○ deploy Tensorflow model
○ scalable inferences with ML Engine
31 Boilerplate example (bit.ly/mlboilerplate)
Link:
ANNEX
32
33 What I didn’t cover
Other (big) data services Ready to use Machine Learning models
Cloud
Vision API
Cloud
Translation API
Cloud Natural
Language API
Cloud
Speech API
Cloud
Jobs API
Cloud Video
Inelligence
Cloud
Datalab
Cloud
Dataproc
Cloud
Dataprep
BigQuery
34 Further reading
Getting Started:
● GCP-ML boilerplate: https://github.com/Fematich/mlengine-boilerplate
● Apache Beam Programming Guide: https://beam.apache.org/documentation/programming-guide
● Tensorflow Getting Started: https://www.tensorflow.org/get_started
● ML Engine documentation: https://cloud.google.com/ml-engine/docs
● Machine Learning Workflow: https://cloud.google.com/ml-engine/docs/concepts/ml-solutions-overview
● Gcloud commands: https://cloud.google.com/sdk/gcloud/reference/ml-engine/
Next Steps:
● Tensorflow Model Zoo: https://github.com/tensorflow/models
● Tensorflow Serving with Kubernetes: https://tensorflow.github.io/serving/serving_inception
● Tensorflow Transform (Preprocessing for ML Engine):
https://research.googleblog.com/2017/02/preprocessing-for-machine-learning-with.html
● Cloudml-magic (Jupyter Notebook magic cmds for ML Engine): https://github.com/hayatoy/cloudml-magic
● Best Practices for ML Engineering: http://martin.zinkevich.org/rules_of_ml/rules_of_ml.pdf
● How HBO’s Silicon Valley built “Not Hotdog” with mobile TensorFlow, Keras & React Native:
http://bit.ly/2w0YWlh
Meetups (Belgium):
● https://www.meetup.com/GDG-Cloud-Belgium
● https://www.meetup.com/TensorFlow-Belgium
Thank you!
@FsMatt

More Related Content

What's hot

Unified MLOps: Feature Stores & Model Deployment
Unified MLOps: Feature Stores & Model DeploymentUnified MLOps: Feature Stores & Model Deployment
Unified MLOps: Feature Stores & Model DeploymentDatabricks
 
MLOps - The Assembly Line of ML
MLOps - The Assembly Line of MLMLOps - The Assembly Line of ML
MLOps - The Assembly Line of MLJordan Birdsell
 
Databricks Overview for MLOps
Databricks Overview for MLOpsDatabricks Overview for MLOps
Databricks Overview for MLOpsDatabricks
 
The A-Z of Data: Introduction to MLOps
The A-Z of Data: Introduction to MLOpsThe A-Z of Data: Introduction to MLOps
The A-Z of Data: Introduction to MLOpsDataPhoenix
 
How to Utilize MLflow and Kubernetes to Build an Enterprise ML Platform
How to Utilize MLflow and Kubernetes to Build an Enterprise ML PlatformHow to Utilize MLflow and Kubernetes to Build an Enterprise ML Platform
How to Utilize MLflow and Kubernetes to Build an Enterprise ML PlatformDatabricks
 
Simplifying Model Management with MLflow
Simplifying Model Management with MLflowSimplifying Model Management with MLflow
Simplifying Model Management with MLflowDatabricks
 
Data Lake: A simple introduction
Data Lake: A simple introductionData Lake: A simple introduction
Data Lake: A simple introductionIBM Analytics
 
Google Vertex AI
Google Vertex AIGoogle Vertex AI
Google Vertex AIVikasBisoi
 
"Managing the Complete Machine Learning Lifecycle with MLflow"
"Managing the Complete Machine Learning Lifecycle with MLflow""Managing the Complete Machine Learning Lifecycle with MLflow"
"Managing the Complete Machine Learning Lifecycle with MLflow"Databricks
 
Word representations in vector space
Word representations in vector spaceWord representations in vector space
Word representations in vector spaceAbdullah Khan Zehady
 
Implementing Microservices by DDD
Implementing Microservices by DDDImplementing Microservices by DDD
Implementing Microservices by DDDAmazon Web Services
 
Microsoft Introduction to Automated Machine Learning
Microsoft Introduction to Automated Machine LearningMicrosoft Introduction to Automated Machine Learning
Microsoft Introduction to Automated Machine LearningSetu Chokshi
 
MLOps Virtual Event: Automating ML at Scale
MLOps Virtual Event: Automating ML at ScaleMLOps Virtual Event: Automating ML at Scale
MLOps Virtual Event: Automating ML at ScaleDatabricks
 
MLOps Bridging the gap between Data Scientists and Ops.
MLOps Bridging the gap between Data Scientists and Ops.MLOps Bridging the gap between Data Scientists and Ops.
MLOps Bridging the gap between Data Scientists and Ops.Knoldus Inc.
 
The Hidden Value of Hadoop Migration
The Hidden Value of Hadoop MigrationThe Hidden Value of Hadoop Migration
The Hidden Value of Hadoop MigrationDatabricks
 
Seamless MLOps with Seldon and MLflow
Seamless MLOps with Seldon and MLflowSeamless MLOps with Seldon and MLflow
Seamless MLOps with Seldon and MLflowDatabricks
 

What's hot (20)

Unified MLOps: Feature Stores & Model Deployment
Unified MLOps: Feature Stores & Model DeploymentUnified MLOps: Feature Stores & Model Deployment
Unified MLOps: Feature Stores & Model Deployment
 
MLOps with Kubeflow
MLOps with Kubeflow MLOps with Kubeflow
MLOps with Kubeflow
 
MLOps - The Assembly Line of ML
MLOps - The Assembly Line of MLMLOps - The Assembly Line of ML
MLOps - The Assembly Line of ML
 
Databricks Overview for MLOps
Databricks Overview for MLOpsDatabricks Overview for MLOps
Databricks Overview for MLOps
 
What is MLOps
What is MLOpsWhat is MLOps
What is MLOps
 
The A-Z of Data: Introduction to MLOps
The A-Z of Data: Introduction to MLOpsThe A-Z of Data: Introduction to MLOps
The A-Z of Data: Introduction to MLOps
 
How to Utilize MLflow and Kubernetes to Build an Enterprise ML Platform
How to Utilize MLflow and Kubernetes to Build an Enterprise ML PlatformHow to Utilize MLflow and Kubernetes to Build an Enterprise ML Platform
How to Utilize MLflow and Kubernetes to Build an Enterprise ML Platform
 
Simplifying Model Management with MLflow
Simplifying Model Management with MLflowSimplifying Model Management with MLflow
Simplifying Model Management with MLflow
 
Data Lake: A simple introduction
Data Lake: A simple introductionData Lake: A simple introduction
Data Lake: A simple introduction
 
Google Vertex AI
Google Vertex AIGoogle Vertex AI
Google Vertex AI
 
MLOps in action
MLOps in actionMLOps in action
MLOps in action
 
"Managing the Complete Machine Learning Lifecycle with MLflow"
"Managing the Complete Machine Learning Lifecycle with MLflow""Managing the Complete Machine Learning Lifecycle with MLflow"
"Managing the Complete Machine Learning Lifecycle with MLflow"
 
Word representations in vector space
Word representations in vector spaceWord representations in vector space
Word representations in vector space
 
Implementing Microservices by DDD
Implementing Microservices by DDDImplementing Microservices by DDD
Implementing Microservices by DDD
 
Semantic search
Semantic searchSemantic search
Semantic search
 
Microsoft Introduction to Automated Machine Learning
Microsoft Introduction to Automated Machine LearningMicrosoft Introduction to Automated Machine Learning
Microsoft Introduction to Automated Machine Learning
 
MLOps Virtual Event: Automating ML at Scale
MLOps Virtual Event: Automating ML at ScaleMLOps Virtual Event: Automating ML at Scale
MLOps Virtual Event: Automating ML at Scale
 
MLOps Bridging the gap between Data Scientists and Ops.
MLOps Bridging the gap between Data Scientists and Ops.MLOps Bridging the gap between Data Scientists and Ops.
MLOps Bridging the gap between Data Scientists and Ops.
 
The Hidden Value of Hadoop Migration
The Hidden Value of Hadoop MigrationThe Hidden Value of Hadoop Migration
The Hidden Value of Hadoop Migration
 
Seamless MLOps with Seldon and MLflow
Seamless MLOps with Seldon and MLflowSeamless MLOps with Seldon and MLflow
Seamless MLOps with Seldon and MLflow
 

Similar to Machine learning at scale with Google Cloud Platform

Architecting Analytic Pipelines on GCP - Chicago Cloud Conference 2020
Architecting Analytic Pipelines on GCP - Chicago Cloud Conference 2020Architecting Analytic Pipelines on GCP - Chicago Cloud Conference 2020
Architecting Analytic Pipelines on GCP - Chicago Cloud Conference 2020Mariano Gonzalez
 
Building a Data Pipeline using Apache Airflow (on AWS / GCP)
Building a Data Pipeline using Apache Airflow (on AWS / GCP)Building a Data Pipeline using Apache Airflow (on AWS / GCP)
Building a Data Pipeline using Apache Airflow (on AWS / GCP)Yohei Onishi
 
Machine learning at scale by Amy Unruh from Google
Machine learning at scale by  Amy Unruh from GoogleMachine learning at scale by  Amy Unruh from Google
Machine learning at scale by Amy Unruh from GoogleBill Liu
 
Google Dremel. Concept and Implementations.
Google Dremel. Concept and Implementations.Google Dremel. Concept and Implementations.
Google Dremel. Concept and Implementations.Vicente Orjales
 
TensorFlow 16: Building a Data Science Platform
TensorFlow 16: Building a Data Science Platform TensorFlow 16: Building a Data Science Platform
TensorFlow 16: Building a Data Science Platform Seldon
 
Building Modern Data Pipelines on GCP via a FREE online Bootcamp
Building Modern Data Pipelines on GCP via a FREE online BootcampBuilding Modern Data Pipelines on GCP via a FREE online Bootcamp
Building Modern Data Pipelines on GCP via a FREE online BootcampData Con LA
 
Big Data and ML on Google Cloud
Big Data and ML on Google CloudBig Data and ML on Google Cloud
Big Data and ML on Google CloudWlodek Bielski
 
Going deep (learning) with tensor flow and quarkus
Going deep (learning) with tensor flow and quarkusGoing deep (learning) with tensor flow and quarkus
Going deep (learning) with tensor flow and quarkusRed Hat Developers
 
Introduction to GCP Data Flow Presentation
Introduction to GCP Data Flow PresentationIntroduction to GCP Data Flow Presentation
Introduction to GCP Data Flow PresentationKnoldus Inc.
 
Introduction to GCP DataFlow Presentation
Introduction to GCP DataFlow PresentationIntroduction to GCP DataFlow Presentation
Introduction to GCP DataFlow PresentationKnoldus Inc.
 
Scaling TensorFlow Models for Training using multi-GPUs & Google Cloud ML
Scaling TensorFlow Models for Training using multi-GPUs & Google Cloud MLScaling TensorFlow Models for Training using multi-GPUs & Google Cloud ML
Scaling TensorFlow Models for Training using multi-GPUs & Google Cloud MLSeldon
 
Day 13 - Creating Data Processing Services | Train the Trainers Program
Day 13 - Creating Data Processing Services | Train the Trainers ProgramDay 13 - Creating Data Processing Services | Train the Trainers Program
Day 13 - Creating Data Processing Services | Train the Trainers ProgramFIWARE
 
Session 8 - Creating Data Processing Services | Train the Trainers Program
Session 8 - Creating Data Processing Services | Train the Trainers ProgramSession 8 - Creating Data Processing Services | Train the Trainers Program
Session 8 - Creating Data Processing Services | Train the Trainers ProgramFIWARE
 
Infrastructure Agnostic Machine Learning Workload Deployment
Infrastructure Agnostic Machine Learning Workload DeploymentInfrastructure Agnostic Machine Learning Workload Deployment
Infrastructure Agnostic Machine Learning Workload DeploymentDatabricks
 
[Giovanni Galloro] How to use machine learning on Google Cloud Platform
[Giovanni Galloro] How to use machine learning on Google Cloud Platform[Giovanni Galloro] How to use machine learning on Google Cloud Platform
[Giovanni Galloro] How to use machine learning on Google Cloud PlatformMeetupDataScienceRoma
 
Structured Streaming in Spark
Structured Streaming in SparkStructured Streaming in Spark
Structured Streaming in SparkDigital Vidya
 
Sawmill - Integrating R and Large Data Clouds
Sawmill - Integrating R and Large Data CloudsSawmill - Integrating R and Large Data Clouds
Sawmill - Integrating R and Large Data CloudsRobert Grossman
 

Similar to Machine learning at scale with Google Cloud Platform (20)

Architecting Analytic Pipelines on GCP - Chicago Cloud Conference 2020
Architecting Analytic Pipelines on GCP - Chicago Cloud Conference 2020Architecting Analytic Pipelines on GCP - Chicago Cloud Conference 2020
Architecting Analytic Pipelines on GCP - Chicago Cloud Conference 2020
 
Building a Data Pipeline using Apache Airflow (on AWS / GCP)
Building a Data Pipeline using Apache Airflow (on AWS / GCP)Building a Data Pipeline using Apache Airflow (on AWS / GCP)
Building a Data Pipeline using Apache Airflow (on AWS / GCP)
 
Machine learning at scale by Amy Unruh from Google
Machine learning at scale by  Amy Unruh from GoogleMachine learning at scale by  Amy Unruh from Google
Machine learning at scale by Amy Unruh from Google
 
Google Dremel. Concept and Implementations.
Google Dremel. Concept and Implementations.Google Dremel. Concept and Implementations.
Google Dremel. Concept and Implementations.
 
TensorFlow 16: Building a Data Science Platform
TensorFlow 16: Building a Data Science Platform TensorFlow 16: Building a Data Science Platform
TensorFlow 16: Building a Data Science Platform
 
Building Modern Data Pipelines on GCP via a FREE online Bootcamp
Building Modern Data Pipelines on GCP via a FREE online BootcampBuilding Modern Data Pipelines on GCP via a FREE online Bootcamp
Building Modern Data Pipelines on GCP via a FREE online Bootcamp
 
Big Data and ML on Google Cloud
Big Data and ML on Google CloudBig Data and ML on Google Cloud
Big Data and ML on Google Cloud
 
Going deep (learning) with tensor flow and quarkus
Going deep (learning) with tensor flow and quarkusGoing deep (learning) with tensor flow and quarkus
Going deep (learning) with tensor flow and quarkus
 
Big Data Analytics With MATLAB
Big Data Analytics With MATLABBig Data Analytics With MATLAB
Big Data Analytics With MATLAB
 
Introduction to GCP Data Flow Presentation
Introduction to GCP Data Flow PresentationIntroduction to GCP Data Flow Presentation
Introduction to GCP Data Flow Presentation
 
Introduction to GCP DataFlow Presentation
Introduction to GCP DataFlow PresentationIntroduction to GCP DataFlow Presentation
Introduction to GCP DataFlow Presentation
 
Scaling TensorFlow Models for Training using multi-GPUs & Google Cloud ML
Scaling TensorFlow Models for Training using multi-GPUs & Google Cloud MLScaling TensorFlow Models for Training using multi-GPUs & Google Cloud ML
Scaling TensorFlow Models for Training using multi-GPUs & Google Cloud ML
 
Day 13 - Creating Data Processing Services | Train the Trainers Program
Day 13 - Creating Data Processing Services | Train the Trainers ProgramDay 13 - Creating Data Processing Services | Train the Trainers Program
Day 13 - Creating Data Processing Services | Train the Trainers Program
 
Session 8 - Creating Data Processing Services | Train the Trainers Program
Session 8 - Creating Data Processing Services | Train the Trainers ProgramSession 8 - Creating Data Processing Services | Train the Trainers Program
Session 8 - Creating Data Processing Services | Train the Trainers Program
 
Infrastructure Agnostic Machine Learning Workload Deployment
Infrastructure Agnostic Machine Learning Workload DeploymentInfrastructure Agnostic Machine Learning Workload Deployment
Infrastructure Agnostic Machine Learning Workload Deployment
 
[Giovanni Galloro] How to use machine learning on Google Cloud Platform
[Giovanni Galloro] How to use machine learning on Google Cloud Platform[Giovanni Galloro] How to use machine learning on Google Cloud Platform
[Giovanni Galloro] How to use machine learning on Google Cloud Platform
 
On-device ML with TFLite
On-device ML with TFLiteOn-device ML with TFLite
On-device ML with TFLite
 
Structured Streaming in Spark
Structured Streaming in SparkStructured Streaming in Spark
Structured Streaming in Spark
 
GCP Slide.pptx
GCP Slide.pptxGCP Slide.pptx
GCP Slide.pptx
 
Sawmill - Integrating R and Large Data Clouds
Sawmill - Integrating R and Large Data CloudsSawmill - Integrating R and Large Data Clouds
Sawmill - Integrating R and Large Data Clouds
 

Recently uploaded

Introduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptxIntroduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptxfirstjob4
 
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
CebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxCebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxolyaivanovalion
 
Week-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionWeek-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionfulawalesam
 
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxolyaivanovalion
 
Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfSchema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfLars Albertsson
 
Unveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data AnalystUnveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data AnalystSamantha Rae Coolbeth
 
BigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxBigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxolyaivanovalion
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfMarinCaroMartnezBerg
 
B2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxB2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxStephen266013
 
Generative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusGenerative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusTimothy Spann
 
Ravak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxRavak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxolyaivanovalion
 
Ukraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICSUkraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICSAishani27
 
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service AmravatiVIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service AmravatiSuhani Kapoor
 
Brighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data StorytellingBrighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data StorytellingNeil Barnes
 
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130Suhani Kapoor
 
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
Invezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz1
 
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Callshivangimorya083
 

Recently uploaded (20)

Introduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptxIntroduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptx
 
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
 
CebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxCebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptx
 
Week-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionWeek-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interaction
 
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptx
 
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
 
Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfSchema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdf
 
Unveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data AnalystUnveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data Analyst
 
BigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxBigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptx
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdf
 
B2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docxB2 Creative Industry Response Evaluation.docx
B2 Creative Industry Response Evaluation.docx
 
Generative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusGenerative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and Milvus
 
Ravak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxRavak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptx
 
Ukraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICSUkraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICS
 
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service AmravatiVIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
 
Brighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data StorytellingBrighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data Storytelling
 
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
 
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
Invezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signals
 
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
 

Machine learning at scale with Google Cloud Platform

  • 1. Machine Learning at scale with GCP using ML Engine & Python Dataflow 19/09/2017 Matthias Feys
  • 2. 2 About ML6/Datatonic We are a team of data scientists, machine learning experts, software engineers and mathematicians. Our mission is to provide tailor-made systems to help your organization get smart actionable insights from large data volumes. + Specialized Machine Learning partner of Google Cloud Matthias Feys GDE for ML and GCP @FsMatt - matthiasfeys@gmail.com
  • 3. 3 Outline Dissecting a Machine Learning Project Mapping the components to GCP tools Building a boilerplate example 1 2 3
  • 4. 4 Opinionated view Focus on tooling not complete overview no focus on models no focus business Caveats
  • 5. 5 Outline Dissecting a Machine Learning Project Mapping the components to GCP tools Building a boilerplate example 1 2 3
  • 6. 6 Popular image of what ML is Lots of data Magical resultsComplex mathematics in multidimensional spaces
  • 7. 7 In reality, ML is Collect data Create model Train model with organized data Organize data Deploy trained model iterate
  • 8. 8 Concrete use case: predict stellar masses* *data and problem of the 1st DSGhent hackathon: https://astrohack.org Predict stellar mass based on: ● image of galaxy ● distance to galaxy
  • 9. 9 Collect & organize data Input: 76k labelled galaxies: ● 1 grayscale image in different CSV files ● all distances to galaxies & actual masses in single CSV file Output: Training, validation & test examples: ● Features: ○ normalized image (matrix of predefined shape) ○ distance & derived features ● Label: ○ actual mass
  • 10. 10 Create & train model Input: Training, validation & test examples Process: ● build model that predicts labels based on features, ● fit model on training data, ● tune hyperparameters ● iterate Output: Best model fitted on the training data with optimal hyperparameters
  • 11. 11 Deploy trained model Input: Best model fitted on the training data with optimal hyperparameters Output: API that accepts input data for a single galaxy: ● 1 grayscale image ● distance to galaxy and returns the predicted stellar mass
  • 12. 12 Outline Dissecting a Machine Learning Project Mapping the components to GCP tools Building a boilerplate example 1 2 3
  • 13. 13 Google Cloud Products Compute Storage Data & Analytics Machine Learning
  • 14. 14 GCP: Open Cloud Philosophy ● Powerful Open Source Frameworks that run everywhere ● Fully Managed Services to run it more easily Cloud Machine Learning Engine TensorFlow Cloud Dataflow Apache Beam
  • 15. 15 Mapping to GCP Products Collect data Create model Train model with organized data Organize data Deploy trained model Cloud Machine Learning Engine Cloud Dataflow Cloud Machine Learning Engine Cloud Storage Tensorflow
  • 16. 16 Datalab/Jupyter notebooks to experiment & iterate Collect data Create model Train model with organized data Organize data Deploy trained model Iterate
  • 17. 17 Google Cloud Storage (GCS) ● Object Storage Service ● Your data lives here: ○ Raw input data ○ Cleaned examples for TF models ○ Serialized Tensorflow models ● Single interface/API, multiple offerings Name Access Frequency Multi-Regional Frequent, Cross-regional Regional Frequent, Single-region Nearline Less than once per month Coldline Less than once per year
  • 18. 18 Apache Beam running on Cloud Dataflow ● Open source, unified model for defining both batch and streaming data-parallel processing pipelines. ● Using one of the open source Beam SDKs, you build a program that defines the pipeline. ● The pipeline is then executed by one of Beam’s supported distributed processing back-ends, which include Apache Apex, Apache Flink, Apache Spark, and Google Cloud Dataflow. Beam Model: Fn Runners Apache Flink Apache Spark Beam Model: Pipeline Construction Other LanguagesBeam Java Beam Python Execution Execution Cloud Dataflow Execution Source: https://beam.apache.org
  • 19. 19 Apache Beam key concepts ● Pipelines: data processing job made of a series of computations including input, processing, and output ● PCollections: bounded (or unbounded) datasets which represent the input, intermediate and output data in pipelines ● PTransforms: data processing step in a pipeline in which one or more PCollections are an input and output ● I/O Sources and Sinks: APIs for reading and writing data which are the roots and endpoints of the pipeline. Source: https://beam.apache.org
  • 20. 20 Apache Beam running on Cloud Dataflow ● Fully-managed data processing service to run Apache Beam pipelines: ○ Automated and optimized work partitioning which can dynamically rebalance lagging work ○ Horizontal dynamic autoscaling of worker resources
  • 21. 21 Collect & organize data with Cloud Dataflow Astrohack use case steps: ● Read: ○ Metadata from 1 csv-file ○ Image data from 76k csv-files ● Combine datasets ● Preprocess and build Tensorflow examples ● Split into train/validation/test set ● Write to TFRecords on GCS
  • 22. 22 Collect & organize data with Cloud Dataflow 1 1 2 2 3 3 4 4 5 5
  • 23. 23 Tensorflow ● Open-source library for machine learning ● Single API for multiple platforms/devices: cpu(s), gpu(s),tpu(s), mobile phones... ● 2 step approach: ○ Construct your model as a computational graph ○ Train your model by pushing data through the graph ● Big community with lots of SotA model implementations
  • 24. 24 ML Engine Training ● Tensorflow Training As a Service ● Data needs to be available online ● No fancy interface (only logging + Tensorboard) ● Same code can run locally to test on small datasets ● Nice features: ○ Easy setup of (GPU) clusters for distributed Tensorflow models ○ Automatic parallel hyperparameter tuning with Hypertune
  • 25. 25 ML Engine Training with contrib.learn and TFRecords on GCS
  • 26. 26 ML Engine Predictions ● Deploy trained model: ○ model (container) ○ version (actual code) ● Predictions: ○ batch ○ online ● Autoscaling
  • 27. 27 ML Engine Predictions
  • 28. 28 GCP components for ML summarized Google Cloud Storage ● All your data lives here ● Very fast access from other GCP services Cloud Dataflow ● Best place to run Apache Beam Pipelines ● Automatically & dynamically scales to 1000’s of cores Cloud ML Engine ● Best place to train & deploy Tensorflow models ● Easy access to clusters of GPU machines to: ○ Train distributed model on multiple machines ○ Automate hyperparameter tuning (in parallel) ● Autoscales the number of serving nodes in response to request traffic
  • 29. 29 Outline Dissecting a Machine Learning Project Mapping the components to GCP tools Building a boilerplate example 1 2 3
  • 30. 30 Boilerplate example ● Starterkit to deploy your Tensorflow project on Google Cloud Platform ● Structure based on the ML Engine samples, simplified ● Usage: ○ build locally on a sample on the dataset (faster for small datasets) ○ run in the cloud on the complete dataset (faster for large datasets) ● Functionalities: ○ preprocess data with Apache Beam (make TFRecords) ○ train Tensorflow model ○ deploy Tensorflow model ○ scalable inferences with ML Engine
  • 31. 31 Boilerplate example (bit.ly/mlboilerplate) Link:
  • 33. 33 What I didn’t cover Other (big) data services Ready to use Machine Learning models Cloud Vision API Cloud Translation API Cloud Natural Language API Cloud Speech API Cloud Jobs API Cloud Video Inelligence Cloud Datalab Cloud Dataproc Cloud Dataprep BigQuery
  • 34. 34 Further reading Getting Started: ● GCP-ML boilerplate: https://github.com/Fematich/mlengine-boilerplate ● Apache Beam Programming Guide: https://beam.apache.org/documentation/programming-guide ● Tensorflow Getting Started: https://www.tensorflow.org/get_started ● ML Engine documentation: https://cloud.google.com/ml-engine/docs ● Machine Learning Workflow: https://cloud.google.com/ml-engine/docs/concepts/ml-solutions-overview ● Gcloud commands: https://cloud.google.com/sdk/gcloud/reference/ml-engine/ Next Steps: ● Tensorflow Model Zoo: https://github.com/tensorflow/models ● Tensorflow Serving with Kubernetes: https://tensorflow.github.io/serving/serving_inception ● Tensorflow Transform (Preprocessing for ML Engine): https://research.googleblog.com/2017/02/preprocessing-for-machine-learning-with.html ● Cloudml-magic (Jupyter Notebook magic cmds for ML Engine): https://github.com/hayatoy/cloudml-magic ● Best Practices for ML Engineering: http://martin.zinkevich.org/rules_of_ml/rules_of_ml.pdf ● How HBO’s Silicon Valley built “Not Hotdog” with mobile TensorFlow, Keras & React Native: http://bit.ly/2w0YWlh Meetups (Belgium): ● https://www.meetup.com/GDG-Cloud-Belgium ● https://www.meetup.com/TensorFlow-Belgium