Custom training notebook tutorials

This document contains a list of available custom training notebook tutorials. These end-to-end tutorials help you get started using custom training and can give you ideas for how to implement a specific project.

There are many environments in which you can host notebooks. You can:

  • Run them in the cloud using a service like Colaboratory (Colab) or Vertex AI Workbench.
  • Download them from GitHub and run them on your local machine.
  • Download them from GitHub and run them on a Jupyter or JupyterLab server in your local network.

Running a notebook in Colab is a way to get started quickly.

To open a notebook tutorial in Colab, click the Colab link in the notebook list. Colab creates a VM instance with all needed dependencies, launches the Colab environment, and loads the notebook.

You can also run the notebook using user-managed notebooks. When you create a user-managed notebooks instance with Vertex AI Workbench, you have full control over the hosting VM. You can specify the configuration and environment of the hosting VM.

To open a notebook tutorial in a Vertex AI Workbench instance:

  1. Click the Vertex AI Workbench link in the notebook list. The link opens the Vertex AI Workbench console.
  2. In the Deploy to notebook screen, type a name for your new Vertex AI Workbench instance and click Create.
  3. In the Ready to open notebook dialog that appears after the instance starts, click Open.
  4. On the Confirm deployment to notebook server page, select Confirm.
  5. Before running the notebook, select Kernel > Restart Kernel and Clear all Outputs.

List of notebooks

  • Select a service
  • AutoML
  • BigQuery
  • BigQuery ML
  • Custom training
  • Image
  • Ray on Vertex AI
  • Tabular
  • Text
  • Vector Search
  • Vertex AI Experiments
  • Vertex AI Feature Store
  • Vertex AI model evaluation
  • Vertex AI Model Monitoring
  • Vertex AI Model Registry
  • Vertex AI Pipelines
  • Vertex AI Prediction
  • Vertex AI TensorBoard
  • Vertex AI Vizier
  • Vertex AI Workbench
  • Vertex Explainable AI
  • Vertex ML Metadata
  • Video

Services Description Open in
Custom training
Vertex AI Prediction
Deploying Iris-detection model using FastAPI and Vertex AI custom container serving.
Learn how to create, deploy and serve a custom classification model on Vertex AI. Learn more about Custom training. Learn more about Vertex AI Prediction.
  • Train a model that uses flower's measurements as input to predict the class of iris.
  • Save the model and its serialized preprocessor.
  • Build a FastAPI server to handle predictions and health checks.
  • Build a custom container with model artifacts.
  • Upload and deploy custom container to Vertex AI Endpoints.
Colab
Colab Enterprise
GitHub
Vertex AI Workbench
Custom training
Custom training with custom container image and automatic model upload to Vertex AI Model Registry.
In this tutorial, you train a machine learning model custom container image approach for custom training in Vertex AI. Learn more about Custom training.
  • Create a Vertex AI custom job for training a model.
  • Train and register a TensorFlow model using a custom container.
  • List the registered model in the Vertex AI Model Registry.
Colab
Colab Enterprise
GitHub
Vertex AI Workbench
Custom training
Get started with Vertex AI Training for XGBoost.
Learn how to use Vertex AI Training for training a XGBoost custom model. Learn more about Custom training.
  • Training using a Python package.
  • Report accuracy when hyperparameter tuning.
  • Save the model artifacts to Cloud Storage using Cloud StorageFuse.
  • Create a Vertex AI model resource.
Colab
Colab Enterprise
GitHub
Vertex AI Workbench
Custom training
Vertex AI Batch Prediction
Custom training and batch prediction.
Learn to use Vertex AI Training to create a custom trained model and use Vertex AI Batch Prediction to do a batch prediction on the trained model. Learn more about Custom training. Learn more about Vertex AI Batch Prediction.
  • Create a Vertex AI custom job for training a TensorFlow model.
  • Upload the trained model artifacts as a model resource.
  • Make a batch prediction.
Colab
Colab Enterprise
GitHub
Vertex AI Workbench
Custom training
Vertex AI Prediction
Custom training and online prediction.
Learn to use Vertex AI Training to create a custom-trained model from a Python script in a Docker container, and learn to use Vertex AI Prediction to do a prediction on the deployed model by sending data. Learn more about Custom training. Learn more about Vertex AI Prediction.
  • Create a Vertex AI custom job for training a TensorFlow model.
  • Upload the trained model artifacts to a Model resource.
  • Create a serving Endpoint resource.
  • Deploy the Model resource to a serving Endpoint resource.
  • Make a prediction.
  • Undeploy the Model resource.
Colab
Colab Enterprise
GitHub
Vertex AI Workbench
Vertex AI Experiments
Vertex ML Metadata
Custom training
Get started with Vertex AI Experiments.
Learn how to use Vertex AI Experiments when training with Vertex AI. Learn more about Vertex AI Experiments. Learn more about Vertex ML Metadata. Learn more about Custom training.
  • Local (notebook) training
  • Create an experiment.
  • Create a first run in the experiment.
  • Log parameters and metrics.
  • Create artifact lineage.
  • Visualize the experiment results.
  • Execute a second run.
  • Compare the two runs in the experiment.
  • Cloud (Vertex AI) training
  • Within the training script
Colab
Colab Enterprise
GitHub
Vertex AI Workbench
Migrate to Vertex AI
Custom training
Custom image classification with a custom training container.
Learn how to train a tensorflow image classification model using a custom container and Vertex AI training. Learn more about Migrate to Vertex AI. Learn more about Custom training.
  • Package the training code into a python application.
  • Containerize the training application using Cloud Build and Artifact Registry.
  • Create a custom container training job in Vertex AI and run it.
  • Evaluate the model generated from the training job.
  • Create a model resource for the trained model in Vertex AI Model Registry.
  • Run a Vertex AI batch prediction job.
  • Deploy the model resource to a Vertex AI endpoint.
  • Run a online prediction job on the model resource.
  • Clean up the resources created.
Colab
Colab Enterprise
GitHub
Vertex AI Workbench
Migrate to Vertex AI
Custom training overview
Custom image classification with a pre-built training container.
Learn how to train a tensorflow image classification model using a prebuilt container and Vertex AI training. Learn more about Migrate to Vertex AI. Learn more about Custom training overview.
  • Package the training code into a python application.
  • Containerize the training application using Cloud Build and Artifact Registry.
  • Create a custom container training job in Vertex AI and run it.
  • Evaluate the model generated from the training job.
  • Create a model resource for the trained model in Vertex AI Model Registry.
  • Run a Vertex AI batch prediction job.
  • Deploy the model resource to a Vertex AI endpoint.
  • Run a online prediction job on the model resource.
  • Clean up the resources created.
Colab
Colab Enterprise
GitHub
Vertex AI Workbench
Migrate to Vertex AI
Custom training overview
Custom Scikit-Learn model with pre-built training container.
Learn how to use Vertex AI Training to create a custom trained model. Learn more about Migrate to Vertex AI. Learn more about Custom training overview.
  • Create a Vertex AI custom job for training a scikitlearn model.
  • Upload the trained model artifacts as a model resource.
  • Generate batch predictions.
  • Deploy the model resource to a serving endpoint resource.
  • Generate online predictions.
  • Undeploy the model resource.
Colab
Colab Enterprise
GitHub
Vertex AI Workbench
Migrate to Vertex AI
Custom training overview
Custom XGBoost model with pre-built training container.
Learn to use Vertex AI Training to create a custom trained model. Learn more about Migrate to Vertex AI. Learn more about Custom training overview.
  • Create a Vertex AI custom job for training a xgboost model.
  • Upload the trained model artifacts as a model resource.
  • Generate batch predictions.
  • Deploy the model resource to a serving endpoint resource.
  • Generate online predictions.
  • Undeploy the model resource.
Colab
Colab Enterprise
GitHub
Vertex AI Workbench
Vertex AI hyperparameter tuning
Custom training
Hyperparameter Tuning.
Learn to use Vertex AI hyperparameter to create and tune a custom trained model. Learn more about Vertex AI hyperparameter tuning. Learn more about Custom training.
  • Create a Vertex AI hyperparameter tuning job for training a TensorFlow model.
Colab
Colab Enterprise
GitHub
Vertex AI Workbench
Vertex AI custom training
Vertex AI model evaluation
Evaluating BatchPrediction results from a custom tabular classification model.
In this tutorial, you train a scikit-learn RandomForest model, save the model in Vertex AI Model Registry and learn how to evaluate the model through a Vertex AI pipeline job using Google Cloud Pipeline Components Python SDK. Learn more about Vertex AI custom training. Learn more about Vertex AI model evaluation.
  • Fetch the dataset from the public source.
  • Preprocess the data locally and save test data in BigQuery.
  • Train a RandomForest classification model locally using scikitlearn Python package.
  • Create a custom container in Artifact Registry for predictions.
  • Upload the model in Vertex AI Model Registry.
  • Create and run a Vertex AI Pipeline that
Colab
Colab Enterprise
GitHub
Vertex AI Workbench
Vertex AI Model Evaluation
Custom training
Evaluating batch prediction results from custom tabular regression model.
Learn how to evaluate a Vertex AI model resource through a Vertex AI pipeline job using google cloud pipeline components. Learn more about Vertex AI Model Evaluation. Learn more about Custom training.
  • Create a Vertex AI Custom Training Job to train a TensorFlow model.
  • Run the custom training job.
  • Retrieve and load the model artifacts.
  • View the model evaluation.
  • Upload the model as a Vertex AI model resource.
  • Import a pretrained Vertex AI model resource into the pipeline.
  • Run a batch prediction job in the pipeline.
  • Evaluate the model using the regression evaluation component.
  • Import the Regression Metrics to the Vertex AI model resource.
Colab
Colab Enterprise
GitHub
Vertex AI Workbench
Vertex AI Pipelines
Custom training components
Custom training with pre-built Google Cloud Pipeline Components.
Learn to use Vertex AI Pipelines and Google Cloud Pipeline Components to build a custom model. Learn more about Vertex AI Pipelines. Learn more about Custom training components.
  • Create a KFP pipeline
Colab
Colab Enterprise
GitHub
Vertex AI Workbench
Vertex AI Pipelines
Custom training components
Model train, upload, and deploy using Google Cloud Pipeline Components.
Learn how to use Vertex AI Pipelines and Google Cloud pipeline component to build and deploy a custom model. Learn more about Vertex AI Pipelines. Learn more about Custom training components.
  • Create a KFP pipeline
Colab
Colab Enterprise
GitHub
Vertex AI Workbench
Custom training
Custom training using Python package, managed text dataset, and TF Serving container.
Learn how to create a custom model using Custom Python Package Training and you learn how to serve the model using TensorFlow-Serving Container for online prediction. Learn more about Custom training.
  • Create utility functions to download data and prepare csv files for creating Vertex AI managed dataset
  • Download Data
  • Prepare CSV Files for creating managed dataset
  • Create custom training Python package
  • Create TensorFlow Serving container
  • Run custom Python package training with managed text dataset
  • Deploy a model and create an endpoint on Vertex AI
  • Predict on the endpoint
  • Create a Batch Prediction job on the model
Colab
Colab Enterprise
GitHub
Vertex AI Workbench
Vertex AI TensorBoard
Custom training
Vertex AI TensorBoard custom training with custom container.
Learn how to create a custom training job using custom containers, and monitor your training process on Vertex AI TensorBoard in near real time. Learn more about Vertex AI TensorBoard. Learn more about Custom training.
  • Create docker repository & config.
  • Create a custom container image with your customized training code.
  • Setup service account and Google Cloud Storage buckets.
  • Create & launch your custom training job with your custom container.
Colab
Colab Enterprise
GitHub
Vertex AI Workbench
Vertex AI TensorBoard
Custom training
Vertex AI TensorBoard custom training with prebuilt container.
Learn how to create a custom training job using prebuilt containers, and monitor your training process on Vertex AI TensorBoard in near real time. Learn more about Vertex AI TensorBoard. Learn more about Custom training.
  • Setup service account and Cloud Storage buckets.
  • Write your customized training code.
  • Package and upload your training code to Cloud Storage.
  • Create & launch your custom training job with Vertex AI TensorBoard enabled for near real time monitoring.
Colab
Colab Enterprise
GitHub
Vertex AI Workbench
Custom training
Training, tuning and deploying a PyTorch text sentiment classification model on Vertex AI.
Learn to build, train, tune and deploy a PyTorch model on Vertex AI. Learn more about Custom training.
  • Create training package for the text classification model.
  • Train the model with custom training on Vertex AI.
  • Check the created model artifacts.
  • Create a custom container for predictions.
  • Deploy the trained model to a Vertex AI Endpoint using the custom container for predictions.
  • Send online prediction requests to the deployed model and validate.
  • Clean up the resources created in this notebook.
Colab
Colab Enterprise
GitHub
Vertex AI Workbench
Custom training
Distributed XGBoost training with Dask.
Learn how to create a distributed training job using XGBoost with Dask. Learn more about Custom training.
  • Configure the PROJECT_ID and LOCATION variables for your Google Cloud project.
  • Create a Cloud Storage bucket to store your model artifacts.
  • Build a custom Docker container that hosts your training code and push the container image to Artifact Registry.
  • Run a Vertex AI SDK CustomContainerTrainingJob
Colab
Colab Enterprise
GitHub
Vertex AI Workbench
Vertex AI Workbench
Custom training
Build a fraud detection model on Vertex AI.
This tutorial demonstrates data analysis and model-building using a synthetic financial dataset. Learn more about Vertex AI Workbench. Learn more about Custom training.
  • Installation of required libraries
  • Reading the dataset from a Cloud Storage bucket
  • Performing exploratory analysis on the dataset
  • Preprocessing the dataset
  • Training a random forest model using scikitlearn
  • Saving the model to a Cloud Storage bucket
  • Creating a Vertex AI model resource and deploying to an endpoint
  • Running the WhatIf Tool on test data
  • Undeploying the model and cleaning up the model resources
Colab
GitHub
Vertex AI Workbench