Book Image

The Definitive Guide to Google Vertex AI

By : Jasmeet Bhatia, Kartik Chaudhary
4 (1)
Book Image

The Definitive Guide to Google Vertex AI

4 (1)
By: Jasmeet Bhatia, Kartik Chaudhary

Overview of this book

While AI has become an integral part of every organization today, the development of large-scale ML solutions and management of complex ML workflows in production continue to pose challenges for many. Google’s unified data and AI platform, Vertex AI, directly addresses these challenges with its array of MLOPs tools designed for overall workflow management. This book is a comprehensive guide that lets you explore Google Vertex AI’s easy-to-advanced level features for end-to-end ML solution development. Throughout this book, you’ll discover how Vertex AI empowers you by providing essential tools for critical tasks, including data management, model building, large-scale experimentations, metadata logging, model deployments, and monitoring. You’ll learn how to harness the full potential of Vertex AI for developing and deploying no-code, low-code, or fully customized ML solutions. This book takes a hands-on approach to developing u deploying some real-world ML solutions on Google Cloud, leveraging key technologies such as Vision, NLP, generative AI, and recommendation systems. Additionally, this book covers pre-built and turnkey solution offerings as well as guidance on seamlessly integrating them into your ML workflows. By the end of this book, you’ll have the confidence to develop and deploy large-scale production-grade ML solutions using the MLOps tooling and best practices from Google.
Table of Contents (24 chapters)
1
Part 1:The Importance of MLOps in a Real-World ML Deployment
4
Part 2: Machine Learning Tools for Custom Models on Google Cloud
14
Part 3: Prebuilt/Turnkey ML Solutions Available in GCP
18
Part 4: Building Real-World ML Solutions with Google Cloud

Setting up HPT jobs on Vertex AI

In this section, we will learn how to set up HPT jobs with Vertex AI. We will use the same neural network model experiment from Chapter 7, Training Fully Custom ML Models with Vertex AI, and optimize its hyperparameters to get the best model settings.

The first step is to create a new Jupyter Notebook in Vertex AI Workbench and import useful libraries:

import numpy as np
import glob
import matplotlib.pyplot as plt
import os
import google.cloud.aiplatform as aiplatform
from google.cloud.aiplatform import hyperparameter_tuning as hpt
from datetime import datetime
TIMESTAMP = datetime.now().strftime("%Y%m%d%H%M%S")
%matplotlib inline

Next, we set up project configurations:

PROJECT_ID='************'
REGION='us-west2'
SERVICE_ACCOUNT='[email protected]'
BUCKET_URI='gs://my-training-artifacts'

Then, we initialize the Vertex AI SDK:

aiplatform.init(project=PROJECT_ID...