AI Platform Training and Prediction


Welcome to the AI Platform Training and Prediction sample code repository. This repository contains samples for how to use AI Platform for model training and serving.

Attention: Visit our new Unified repo AI Platform samples

Google Machine Learning Repositories


The repository is organized by tasks:

Each task can be broken down to general usage (CPU/GPU) to specific features:

Scroll down to see what we have available, each task may provide a notebook or code solution. Where the code solution will have a README guide and the notebook solution is a full walkthrough. Our code guides are designed to provide you with the code and instructions on how to run the code, but leave you to do the digging, where our notebook tutorials try to walk you through the whole process by having the code available in the notebook throughout the guide.

If you don’t see something for the task you’re trying to complete, please head down to our section What do you want to see?


For installation instructions and overview, please see the documentation. Please refer to in each sample directory for more specific instructions.

Getting Started

If this is your first time using AI Platform, we suggest you take a look at the Introduction to AI Platform docs to get started.

AI Platform Training

Notebook Tutorial:

Code Guide:

Cloud TPUs

Tensor Processing Units (TPUs) are Google’s custom-developed ASICs used to accelerate machine-learning workloads. You can run your training jobs on AI Platform, using Cloud TPU.

Hyperparameter Tuning (HP Tuning)

Notebook Tutorial:


AI Platform Prediction (Online Predictions)

Notebook Tutorial:

Complete Guide: Model Training and Prediction on AI Platform

Code Guide:

Hyperparameter Tuning (HP Tuning)

Code Guide:


Additional Resources

What do you want to see?

If you came looking for a sample we don’t have, please file an issue using the Sample / Feature Request template on this repository. Please provide as much detail as possible about the AI Platform sample you were looking for, what framework (Tensorflow, Keras, scikit-learn, XGBoost, PyTorch...), the type of model, and what kind of dataset you were hoping to use!

Jump below if you want to contribute and add that missing sample.

How to contribute?

We welcome external sample contributions! To learn more about contributing new samples, checkout our guide. Please feel free to add new samples that are built in notebook form or code form with a README guide.

Want to contribute but don't have an idea? Check out our Sample Request Page and assign the issue to yourself so we know you're working on it!


We host AI Platform documentation here