Google Cloud Machine Learning Engine

Note: If you’re looking for our guides on how to do Machine Learning on Google Cloud Platform (GCP) using other services, please checkout our other repository: ML on GCP, which has guides on how to bring your code from various ML frameworks to Google Cloud Platform using things like Google Compute Engine or Kubernetes.

Setup

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

Getting Started

Overview

The repository is organized by tasks (Training, Serving, Training and Serving) and each task can be broken down to general usage (CPU/GPU) to specific features: Hyperparameter Tuning and TPUs. Scroll down to see what we have available, each task may provide a code or notebook 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?

Tensorflow: ResNet - How to train a model for image recognition using the CIFAR10 dataset to classify image content (training on one CPU, a single host with multiple GPUs, and multiple hosts with CPU or multiple GPUs).

Hyperparameter Tuning (HP Tuning)

scikit-learn: Lasso Regressor - How to train a Lasso Regressor in scikit-learn using a text based dataset, auto mpg, to predict a car's miles per gallon.

XGBoost: XGBRegressor - How to train a Regressor in XGBoost using a text based dataset, auto mpg, to predict a car's miles per gallon.

Model Serving (Online Predictions)

Notebook Tutorial:

scikit-learn: Model Serving - How to train a Random Forest Classifier in scikit-learn on your local machine using a text based dataset, Census, to predict a person’s income level and deploy it on Cloud ML Engine to create predictions.

XGBoost: Model Serving - How to train an XGBoost model on your local machine using a text based dataset, Census, to predict a person’s income level and deploy it on Cloud ML Engine to create predictions.

Templates

TensorFlow Estimator Trainer Package Template - When training a Tensorflow model, you have to create a trainer package, here we have a template that simplifies creating a trainer package for Cloud ML Engine. Take a look at this list with some introductory examples.

Google Samples

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 ML Engine sample you were looking for, what framework (Tensorflow, Keras, scikit-learn, XGBoost, ...), 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 CONTRIBUTING.md 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!