Skip to content

Latest commit

 

History

History
452 lines (396 loc) · 20.5 KB

readme.md

File metadata and controls

452 lines (396 loc) · 20.5 KB

ga4

Vertex AI for Machine Learning Operations

👋 I'm Mike

I want to share and enable Vertex AI from Google Cloud with you. The goal here is to share a comprehensive set of end-to-end workflows for machine learning that each cover the range of data to model to serving and managing - even automating the flow. Regardless of your data type, skill level or framework preferences you will find something helpful here.

Click to watch on YouTube

Click here to see current playlist for this repository


Tracking

To better understand which content is most helpful to users, this repository uses tracking pixels in each markdown (.md) and notebook (.ipynb) file. No user or location information gets captured as this is set to use a dummy client and session to protect privacy. The only information captured is that the content was rendered/viewed which gives us a daily count of usage. Please share any concerns you have with this in repositories discussion board and I am happy to also provide a branch without the tracking.

A script is provided to remove this tracking from your local copy of this repository in the file ga4_remove.py in the folder ga4.


Table of Contents


Considerations

Data Type

  • Tables: Tabular, structured data in rows and columns
  • Language: Text for translation and/or understanding
  • Vision: Images
  • Video

Convenience Level

  • Use Pre-Trained APIs
  • Automate building Custom Models
  • End-to-end Custom ML with core tools in the framework of your choice

Framework Preferences


Overview

This is a series of workflow demonstrations that use the same data source to build and deploy the same machine learning model with different frameworks and automation. These are meant to help get started in understanding and learning Vertex AI and provide starting points for new projects.

The demonstrations focus on workflows and don't delve into the specifics of ML frameworks other than how to integrate and automate with Vertex AI. Let me know if you have ideas for more workflows or details to include!

To understand the contents of this repository, the following charts uncover the groupings of the content.

Direction

Pre-Trained APIs

Pre-Trained Models AutoML
Data Type Pre-Trained Model Prediction Types Related Solutions

Text

Cloud Translation API
Detect, Translate
Cloud Text-to-Speech

AutoML Translation

Cloud Natural Language API
Entities (Identify and label), Sentiment, Entity Sentiment, Syntax, Content Classification
Healthceare Natural Language API

AutoML Text

Image

Cloud Vision API
Crop Hint, OCR, Face Detect, Image Properties, Label Detect, Landmark Detect, Logo Detect, Object Localization, Safe Search, Web Detect

Document AI

Visual Inspection AI

AutoML Image

Audio

Cloud Media Translation API
Real-time speech translation
Cloud Speech-to-Text

Video

Cloud Video Intelligence API
Label Detect*, Shot Detect*, Explicit Content Detect*, Speech Transcription, Object Tracking*, Text Detect, Logo Detect, Face Detect, Person Detect, Celebrity Recognition
Vertex AI Vision

AutoML Video

AutoML

AutoML
Data Type
AutoML
Prediction Types

Table

AutoML Tables
Classification
Binary
Multi-class
Regression
Forecasting

Image

AutoML Image
Classification
Single-label
Multi-label
Object Detection

Video

AutoML Video
Classification
Object Detection
Action Recognition

Text

AutoML Text
Classification
Single-label
Multi-label
Entity Extraction
Sentiment Analysis

Text

AutoML Translation
Translation

With Training Data

This work focuses on cases where you have training data:

Overview
AutoML BigQuery ML Vertex AI Forecasting with AutoML, BigQuery ML, OSS Prophet

Vertex AI For ML Training

       


Vetex AI

Vetex AI is a platform for end-to-end model development. It consist of core components that make the processes of MLOps possible for design patterns of all types.

Components         Console


Interacting with Vertex AI

Many Vertex AI resources can be viewed and monitored directly in the GCP Console. Vertex AI resources are primarily created, and modified with the Vertex AI API.

The API is accessible from:

The notebooks in this repository primarily use the Python client aiplatform. There is occasional use of aiplatform.gapic, aiplatform_v1 and aiplatform_v1beta1.

For the full details on the APIs versions and layers and how/when to use each, see this helpful note.

Install the Vertex AI Python Client

pip install google-cloud-aiplatform

Example Usage: Listing all Model in Vertex AI Model Registry

PROJECT = 'statmike-mlops-349915'
REGION = 'us-central1'

# List all models for project in region with: aiplatform
from google.cloud import aiplatform
aiplatform.init(project = PROJECT, location = REGION)

model_list = aiplatform.Model.list()

Setup

The demonstrations are presented in a series of JupyterLab notebooks. These can be reviewed directly in this repository on GitHub or cloned to your Jupyter instance on Vertex AI Workbench.

Option 1: Review files directly

Select the files and review them directly in the browser or IDE of your choice. This can be helpful for general understanding and selecting sections to copy/paste to your project.

Option 2: Run These Notebooks in a Vertex AI Workbench based Notebook

TL;DR

In Google Cloud Console, Select/Create a Project then go to Vertex AI > Workbench > User-Managed Notebooks

  • Create a new notebook and Open JupyterLab
  • Clone this repository using Git Menu, Open and run 00 - Environment Setup.ipynb
  1. Create a Project
    1. Link, Alternatively, go to: Console > IAM & Admin > Manage Resources
    2. Click "+ Create Project"
    3. Provide: name, billing account, organization, location
    4. Click "Create"
  2. Enable the APIs: Vertex AI API and Notebooks API
    1. Link
      1. Alternatively, go to:
        1. Console > Vertex AI, then enable API
        2. Then Console > Vertex AI > Workbench, then enable API
  3. Create A Notebook
    1. Link, Alternatively, go to: Console > Vertex AI > Workbench
    2. Click User-Managed Notebooks
    3. Click "+ Create Notebook" or "+ New Notebook"
    4. Selections:
      1. Tensorflow Enterprise > Tensorflow Enterprise 2.3 > Without GPUs
      2. Provide: name, region = us-central1, machine type = n1-standard-4
      3. some options may be under "Advanced Options"
    5. Click "Create"
  4. Open JupyterLab Notebook Instance
    1. Once the Notebook Instance is started click the "Open JupyterLab" link
    2. Clone This Repository to the Notebook Instance
      1. Use the Git Menu at the top or on the left navigation bar to select "Clone a Repository"
      2. Provide the Clone URI of this repository: https://github.com/statmike/vertex-ai-mlops.git
      3. In the File Browser you will now have the folder "vertex-ai-mlops" that contains the files from this repository
  5. Setup the Notebook Environment for these workflows
    1. Open the notebook vertex-ai-mlops/00 - Environment Setup
    2. Follow the instructions and run the cells

Resources on these items:


Helpful Sections

  • Learning Machine Learning
    • I often get asked "How do I learn about ML?". There are lots of good answers. ....
  • Explorations
    • This is a series of projects for exploring new, new-to-me, and emerging tools in the ML world!
  • Tips
    • Tips for using the repository and notebooks with examples of core skills like building containers, parameterizing jobs and interacting with other GCP services. These tips help with scaling jobs and developing them with a focus on CI/CD.

More Resources Like This Repository

This is my personal repository of demonstrations I use for learning and sharing Vertex AI. There are many more resources available. Within each notebook I have included a resources section and a related training section.


ToDo

See individual todo list in the readme within each folder of the repository

  • for each notebook add a list of api's, roles, perimission used
  • use virtualenv throughout
  • move all setup of apis into the 00 folder and reference them as prerequisites
  • add colab link in all notebooks (if possible)
  • remove numbering from frameworks
  • New folder MLOps that pull all dev tools and workflows together