[GCP ML engineer certification Day6]

Updated:

Machine Learning with Tensorflow on Google Cloud Platorm (Coursera Lecture)

Lecture preview

1

Why Google

  • There are over 4,000 Tensorflow machine learning modesls in production at Google 2

Why Google Cloud

  • To be successful at ML, you need to think not just about creating models, but also about serving out ML predictions 3

  • On GCP, the key services are all serverless and they’re all managed infrastructure
  • By building data pipelines in Google Cloud, you essentially get to take advantage of the scalability, reliability, and sheer engineering progress that Google brings to running machine learning systems 4

Review Question

  1. What is a common reason for an ML model that works well in training but fails in production?
    • The ML dataset was improperly created
  2. Personalized Algorithms are often built using which type of ML model?
    • Recommendation systems
  3. What is a key lesson Google has learned with regards to reducing the chance of failure in production ML models?
    • Process batch data and streaming data the same way

AI VS Machine Learning

  • AI is a discipline, it has to do with the theory and methods to build machines think & act like humans
  • Machine Learning is a toolset, so we can use machine learning to solve certain kinds of AI problems

Two stages of AI

  1. Train an ML model with examples train

  2. Inference (Predict with a trained model) inf

total

ML in Google product

product

  • ML is part of pretty much every Google product
  • In practice, you will have to build many ML modles to solve one problem
  • EX. How to forecast whether an item will go out of stock
    • First model to predict demand for the product at the store location
    • Second model to predict the inventory of this item at the supplier’s warehouses and nearby tores
    • Third model to predict how long it is going to take them to stock the product and use this to predict which supplier you will ask to refill, and when
    • etc…

Review Question

  1. The main stages of Machine Learning models are?
    • Train an ML model
    • Predict with a trained model
  2. What are common mathematical models used in Machine Learning?
    • Linear methods
    • Decision Trees
    • Radial basis functions
  3. In the past, why did neural networks models have just a few layers?
    • Neural networks with lots of layers takes a lot of computing power
    • As you add more layers, there are more weights to adjust, and you need lots more data available to make those adjustments
    • If you just add layers, you may run into issues, for example some of the layers may become all zero or blow up and become NAM (not a number)
  4. What are the models included in Google Translate app?
    • Find the sign
    • Read the sign
    • Detect the language
  5. What is the smart reply feature of Inbox and Gmail?
    • The email program suggests three possible responses to received emails

Pre-trained models

  • There are variety of domains where Google exposes ML services trained with their own data model
  • Two ways that Google Cloud Platform can help you add Machine learning to your applications
    • tools to help you build custom machine-learning models
      • Tensorflow lets you build and train your own machine learning models, using your own data
      • If you want to run tensorflow models on managed Google infrastructure, use Cloud Machine Learning Engine
    • friendly machine learning (pre-trained APIs)
      • give you access to pre-trained machine learning models, with a single REST API request

Vision API in action

  • Cloud Vision is an API that lets you perform complex image detection with a single rest API request
  • label and Web detection
    • tell you what is this a picture of
    • search for similar images across the web and extract content from the pages where those images are found to return additional details on your image
  • OCR (Optical Character Recognition)
    • extract text from the images
    • tell you where that text was found
    • tell you what language that text is in
  • Logo Detection
    • identify company logos in an image
  • Landmark Detection
    • tell if an image contains a common landmark
    • provide the latitude-longitude coordinates of that landmark
  • Crop hints
    • crop your photos to focus on a particular subject

Video Intelligence API

  • Label detection
    • tells you what’s in this video
    • At a high level, it’ll tell you what is your video about
    • In a more granular level, it can tell you what’s happening in every scene of your video
  • Shot change detection
    • if your video changes from a landscape pan to a close-up of a person doing an interview, it’ll give you the timestamps every time the camera changes shots
  • Explicit content detection
    • identify inappropriate scenes in your video
  • Regionalization
    • specify the region where your video API requests should be executed

Cloud Speech-to-Text API

  • Cloud speech is an API that let’s you perform speech to text transcription in over 100 languages
  • Speech-to-text transcription
    • lets you pass it in audio file and it returns a text transcription of that file
  • Speech timestamps
    • it will return the start and end time for every word in your audio transcription, which makes it really easy to search within your audio
  • Profanity filtering
  • Perform either batch or streaming transcription

Cloud Translation API

  • API that let’s you translate text into over 100 different languages
  • Translate text
  • Detect the language of your text

Cloud Natural Language API

  • Cloud Natural Language is an API that let’s you understand texts with a single rest API request
  • Extract entities
  • Detect sentiment
  • Analyze syntax
  • Classify content

Cloud Text-to-Speech API

  • Cloud Text-to-Speech is an API that lets you convert text into human-like speech
  • pass it to text file and it returns raw audio data as a base64 encoded string
  • You must decode this base64 encoded string to an audio file before an application can play it
  • creates raw audio data of natural human speech
  • access more than 180 voices across more than 30 languages in variants

DialogFlow

  • used for building conversational interfaces
  • analyze text or audio and respond to a human in a natural chatty way
  • an authoring platform, not just an API, but it’s possible to manage your chat bot through its API dialogflow

Review Question

  1. Which of the following is not a pre-trained machine learning model on goole cloud?
    • Tensorflow
  2. Which API lets you perform complex image detection with a single REST API request?
    • Cloud Vision API
  3. Which API lets you understand your video’s entities at shot, frame or video level?
    • Cloud video intelligence API
  4. What are the benefits of cloud speech-to-text API?
    • perform speech-to-text transcription
    • supports speech timestamps
    • supports profanity filtering
  5. What type of actions can be done by Cloud Natural Language API?
    • Gives you the overall sentiment of a sentence or a text document

Manual data analysis

Typical customer journey involves going from manual data analysis to ML

  • if you’re doing manual data analysis, you probably have the data already
  • if you cannot analyze your data to get reasonable inputs towards making decisions, then there’s no point in doing machine learning
  • to build a good machine learning model you have to know your data

Training and serving skew

skew

  • Problem
    • unless the model sees the exact same data in serving, and as it was used to seeing during training, the model predictions are going to be off
    • the result of stream processing and the result of branch processing have to be the same
  • Solution sol
    • take the same code that was used to process historical data during training and reuse it during predictions
    • data pipelines have to process both Batch and Stream

ML phrases

phrases

  • MLOps
    • How do you reduce the time between analyzing their problem, creating the models, and deploying the solution, while maintaining the quality of the output?
    • lifecycle management discipline for machine learning

Review Question

  1. What would you use to replace user input by machine learning?
    • Pre-trined model
  2. Which of the following refers to the type of data used in ML models?
    • Labeld data, Unlabeled data
  3. Which of the following are best practices for Data preparation?
    • Avoid training-serving skew
    • Avoid target leakage
    • Provide a time signal
  4. Which of the following is not part of the ML training phase?
    • Connecting Neural Networks
  5. What’s the most efficient way to transcribe speech?
    • Use Speech API

Categories:

Updated:

Leave a comment