Before using AI Platform with this tutorial, you should be familiar with machine learning and TensorFlow. To learn more, refer to Machine Learning Crash Course using TensorFlow APIs. For many more educational resources about machine learning, see Learn with Google AI.
Overview
This document provides an introductory, end-to-end walkthrough of training and prediction on AI Platform. You will walk through a sample that uses a census dataset to:
- Create a TensorFlow 1.14 training application and validate it locally.
- Run your training job on a single worker instance in the cloud.
- Run your training job as a distributed training job in the cloud.
- Optimize your hyperparameters by using hyperparameter tuning.
- Deploy a model to support prediction.
- Request an online prediction and see the response.
- Request a batch prediction.
What you will build
The sample builds a wide and deep model for predicting income category based on United States Census Income Dataset. The two income categories (also known as labels) are:
- >50K—Greater than 50,000 dollars
- <=50K—Less than or equal to 50,000 dollars
Wide and deep models use deep neural nets (DNNs) to learn high-level abstractions about complex features or interactions between such features. These models then combine the outputs from the DNN with a linear regression performed on simpler features. This provides a balance between power and speed that is effective on many structured data problems.
You can read more about wide and deep models in the Google Research Blog post named Wide & Deep Learning: Better Together with TensorFlow.
The sample defines the model using TensorFlow's prebuilt
DNNCombinedLinearClassifier
class. The sample defines the data
transformations particular to the census dataset,
then assigns these (potentially) transformed features to either the DNN or
the linear portion of the model.
Costs
This walkthrough uses billable components of Google Cloud, including:
- AI Platform for:
- Training
- Prediction
- Cloud Storage for:
- Storing input data for training
- Staging the training application package
- Writing training artifacts
- Storing input data files for batch prediction
Use the Pricing Calculator to generate a cost estimate based on your projected usage.
Set up and test your Cloud environment
Complete the following steps to set up a GCP account, activate the AI Platform API, and install and activate the Cloud SDK.
Set up your GCP project
-
Sign in to your Google Account.
If you don't already have one, sign up for a new account.
-
In the Google Cloud Console, on the project selector page, select or create a Google Cloud project.
-
Make sure that billing is enabled for your Cloud project. Learn how to confirm that billing is enabled for your project.
- Enable the AI Platform Training & Prediction and Compute Engine APIs.
- Install and initialize the Cloud SDK.
Set up your environment
Choose one of the options below to set up your environment locally on macOS or in a remote environment on Cloud Shell.
For macOS users, we recommend that you set up your environment using the MACOS tab below. Cloud Shell, shown on the CLOUD SHELL tab, is available on macOS, Linux, and Windows. Cloud Shell provides a quick way to try AI Platform, but isn't suitable for ongoing development work.
macOS
-
Check Python installation
Confirm that you have Python installed and, if necessary, install it.python -V
-
Check
pip
installation
pip
is Python's package manager, included with current versions of Python. Check if you already havepip
installed by runningpip --version
. If not, see how to installpip
.You can upgrade
pip
using the following command:pip install -U pip
See the pip documentation for more details.
-
Install
virtualenv
virtualenv
is a tool to create isolated Python environments. Check if you already havevirtualenv
installed by runningvirtualenv --version
. If not, installvirtualenv
:pip install --user --upgrade virtualenv
To create an isolated development environment for this guide, create a new virtual environment in
virtualenv
. For example, the following command activates an environment namedaip-env
:virtualenv aip-env source aip-env/bin/activate
-
For the purposes of this tutorial, run the rest of the commands within your virtual environment.
See more information about usingvirtualenv
. To exitvirtualenv
, rundeactivate
.
Cloud Shell
-
Open the Google Cloud Console.
-
Click the Activate Google Cloud Shell button at the top of the console window.
A Cloud Shell session opens inside a new frame at the bottom of the console and displays a command-line prompt. It can take a few seconds for the shell session to be initialized.
Your Cloud Shell session is ready to use.
-
Configure the
gcloud
command-line tool to use your selected project.gcloud config set project [selected-project-id]
where
[selected-project-id]
is your project ID. (Omit the enclosing brackets.)
Python version support
The sample for this tutorial uses Python 2.7. AI Platform Training and AI Platform Prediction also support Python 3. See how to select a Python version when submitting a training job.
Download the code for this tutorial
Download the sample from the GitHub repository.
macOS
Download and extract the AI Platform sample zip file.
Open a terminal window and navigate to the directory that contains the extracted
cloudml-samples-master
directory.Navigate to the
cloudml-samples-master > census > estimator
directory. The commands in this walkthrough must be run from theestimator
directory.cd cloudml-samples-master/census/estimator
Cloud Shell
Enter the following command to download the AI Platform sample zip file:
wget https://github.com/GoogleCloudPlatform/cloudml-samples/archive/master.zip
Unzip the file to extract the
cloudml-samples-master
directory.unzip master.zip
Navigate to the
cloudml-samples-master > census > estimator
directory. The commands in this walkthrough must be run from theestimator
directory.cd cloudml-samples-master/census/estimator
Develop and validate your training application locally
Before you run your training application in the cloud, get it running locally. Local environments provide an efficient development and validation workflow so that you can iterate quickly. You also won't incur charges for cloud resources when debugging your application locally.
Get your training data
The relevant data files, adult.data
and adult.test
, are hosted in a public
Cloud Storage bucket. For purposes of this sample, use the versions on
Cloud Storage, which have undergone some trivial cleaning, instead of
the original source data. See below for more information
about the data.
You can read the data files directly from Cloud Storage or copy them to your local environment. For purposes of this sample you will download the samples for local training, and later upload them to your own Cloud Storage bucket for cloud training.
Download the data to a local file directory and set variables that point to the downloaded data files.
mkdir data gsutil -m cp gs://cloud-samples-data/ai-platform/census/data/* data/
Set the
TRAIN_DATA
ANDEVAL_DATA
variables to your local file paths. For example, the following commands set the variables to local paths.TRAIN_DATA=$(pwd)/data/adult.data.csv EVAL_DATA=$(pwd)/data/adult.test.csv
The data is stored in comma-separated value format
as shown by the following preview of the adult.data
file:
39, State-gov, 77516, Bachelors, 13, Never-married, Adm-clerical, Not-in-family, White, Male, 2174, 0, 40, United-States, <=50K 50, Self-emp-not-inc, 83311, Bachelors, 13, Married-civ-spouse, Exec-managerial, Husband, White, Male, 0, 0, 13, United-States, <=50K 38, Private, 215646, HS-grad, 9, Divorced, Handlers-cleaners, Not-in-family, White, Male, 0, 0, 40, United-States, <=50K 53, Private, 234721, 11th, 7, Married-civ-spouse, Handlers-cleaners, Husband, Black, Male, 0, 0, 40, United-States, <=50K ...
Install dependencies
macOS
With the virtual environment that you activated in a previous step activated, run the following command:
pip install tensorflow==1.14.*
Running this command installs TensorFlow 1.14, which is used in the tutorial.
Cloud Shell
Although TensorFlow is installed on Cloud Shell, you must run the following command to ensure you are using the same version of TensorFlow required by the sample:
pip install --user tensorflow==1.14.*
Running this command installs TensorFlow 1.14, which is used in the tutorial.
Run a local training job
A local training job loads your Python training program and starts a training process in an environment that's similar to that of a live AI Platform cloud training job.
Specify an output directory and set a
MODEL_DIR
variable. The following command setsMODEL_DIR
to a value ofoutput
.MODEL_DIR=output
It's a good practice to delete the contents of the output directory in case data remains from a previous training run. The following command deletes all data in the
output
directory.rm -rf $MODEL_DIR/*
To run your training locally, run the following command:
gcloud ai-platform local train \ --module-name trainer.task \ --package-path trainer/ \ --job-dir $MODEL_DIR \ -- \ --train-files $TRAIN_DATA \ --eval-files $EVAL_DATA \ --train-steps 1000 \ --eval-steps 100
By default, verbose logging is turned off. You can enable it by setting the
--verbosity
tag to DEBUG
. A later example shows you how to enable it.
Inspect the summary logs using Tensorboard
To see the evaluation results, you can use the visualization tool called TensorBoard. With TensorBoard, you can visualize your TensorFlow graph, plot quantitative metrics about the execution of your graph, and show additional data like images that pass through the graph. Tensorboard is available as part of the TensorFlow installation.
Follow the steps below to launch TensorBoard and point it at the summary logs produced during training, both during and after execution.
macOS
Launch TensorBoard:
tensorboard --logdir=$MODEL_DIR
When you have started running TensorBoard, you can access it in your browser at http://localhost:6006
Cloud Shell
Launch TensorBoard:
tensorboard --logdir=$MODEL_DIR --port=8080
Select "Preview on port 8080" from the Web Preview menu at the top of the command line.
Click on Accuracy to see graphical representations of how accuracy changes as your job progresses.
You can shut down TensorBoard at any time by typing ctrl+c
on the
command line.
Run a local training job in distributed mode
You can test whether your model works with the AI Platform's
distributed execution environment by running a local training job using the
--distributed
flag.
Specify an output directory and set
MODEL_DIR
variable again. The following command setsMODEL_DIR
to a value ofoutput-dist
.MODEL_DIR=output-dist
Delete the contents of the
output
directory in case data remains from a previous training run.rm -rf $MODEL_DIR/*
Run the
local train
command using the--distributed
option. Be sure to place the flag above the--
that separates the user arguments from the command-line arguments.gcloud ai-platform local train \ --module-name trainer.task \ --package-path trainer/ \ --job-dir $MODEL_DIR \ --distributed \ -- \ --train-files $TRAIN_DATA \ --eval-files $EVAL_DATA \ --train-steps 1000 \ --eval-steps 100
Inspect the output
Output files are written to the directory specified by --job-dir
, which was
set to output-dist
:
ls -R output-dist/
You should see output similar to this:
checkpoint
eval
events.out.tfevents.1488577094.<host-name>
export
graph.pbtxt
model.ckpt-1000.data-00000-of-00001
model.ckpt-1000.index
model.ckpt-1000.meta
model.ckpt-2.data-00000-of-00001
model.ckpt-2.index
model.ckpt-2.meta
output-dist//eval:
events.out.tfevents.<timestamp>.<host-name>
events.out.tfevents.<timestamp><host-name>
events.out.tfevents.<timestamp>.<host-name>
output-dist//export:
census
output-dist//export/census:
<timestamp>
output-dist//export/census/<timestamp>:
saved_model.pb
variables
...
Inspect the logs
Inspect the summary logs using Tensorboard the same way that you did for the
single-instance training job except that you must change the --logdir
value to
match the output directory name you used for distributed mode.
macOS
Launch TensorBoard:
tensorboard --logdir=$MODEL_DIR
When you have started running TensorBoard, you can access it in your browser at http://localhost:6006
Cloud Shell
Launch TensorBoard:
tensorboard --logdir=$MODEL_DIR --port=8080
Select "Preview on port 8080" from the Web Preview menu at the top of the command line.
Set up your Cloud Storage bucket
This section shows you how to create a new bucket. You can use an existing bucket, but it must be in the same region where you plan on running AI Platform jobs. Additionally, if it is not part of the project you are using to run AI Platform, you must explicitly grant access to the AI Platform service accounts.
-
Specify a name for your new bucket. The name must be unique across all buckets in Cloud Storage.
BUCKET_NAME="your_bucket_name"
For example, use your project name with
-aiplatform
appended:PROJECT_ID=$(gcloud config list project --format "value(core.project)") BUCKET_NAME=${PROJECT_ID}-aiplatform
-
Check the bucket name that you created.
echo $BUCKET_NAME
-
Select a region for your bucket and set a
REGION
environment variable.Use the same region where you plan on running AI Platform jobs. See the available regions for AI Platform services.
For example, the following code creates
REGION
and sets it tous-central1
:REGION=us-central1
-
Create the new bucket:
gsutil mb -l $REGION gs://$BUCKET_NAME
Upload the data files to your Cloud Storage bucket.
Use
gsutil
to copy the two files to your Cloud Storage bucket.gsutil cp -r data gs://$BUCKET_NAME/data
Set the
TRAIN_DATA
andEVAL_DATA
variables to point to the files.TRAIN_DATA=gs://$BUCKET_NAME/data/adult.data.csv EVAL_DATA=gs://$BUCKET_NAME/data/adult.test.csv
Use
gsutil
again to copy the JSON test filetest.json
to your Cloud Storage bucket.gsutil cp ../test.json gs://$BUCKET_NAME/data/test.json
Set the
TEST_JSON
variable to point to that file.TEST_JSON=gs://$BUCKET_NAME/data/test.json
Run a single-instance training job in the cloud
With a validated training job that runs in both single-instance and distributed mode, you're now ready to run a training job in the cloud. You'll start by requesting a single-instance training job.
Use the default BASIC
scale tier
to run a single-instance training job. The initial job request can take a few
minutes to start, but subsequent jobs run more quickly. This enables quick
iteration as you develop and validate your training job.
Select a name for the initial training run that distinguishes it from any subsequent training runs. For example, you can append a number to represent the iteration.
JOB_NAME=census_single_1
Specify a directory for output generated by AI Platform by setting an
OUTPUT_PATH
variable to include when requesting training and prediction jobs. TheOUTPUT_PATH
represents the fully qualified Cloud Storage location for model checkpoints, summaries, and exports. You can use theBUCKET_NAME
variable you defined in a previous step.It's a good practice to use the job name as the output directory. For example, the following
OUTPUT_PATH
points to a directory namedcensus_single_1
.OUTPUT_PATH=gs://$BUCKET_NAME/$JOB_NAME
Run the following command to submit a training job in the cloud that uses a single process. This time, set the
--verbosity
tag toDEBUG
so that you can inspect the full logging output and retrieve accuracy, loss, and other metrics. The output also contains a number of other warning messages that you can ignore for the purposes of this sample.gcloud ai-platform jobs submit training $JOB_NAME \ --job-dir $OUTPUT_PATH \ --runtime-version 1.14 \ --python-version 2.7 \ --module-name trainer.task \ --package-path trainer/ \ --region $REGION \ -- \ --train-files $TRAIN_DATA \ --eval-files $EVAL_DATA \ --train-steps 1000 \ --eval-steps 100 \ --verbosity DEBUG
You can monitor the progress of your training job by watching the command-line output or in AI Platform > Jobs on Google Cloud Console.
Inspect the output
In cloud training, outputs are produced into Cloud Storage.
In this sample, outputs are saved to OUTPUT_PATH
; to list them, run:
gsutil ls -r $OUTPUT_PATH
The outputs should be similar to the outputs from training locally (above).
Inspect the Cloud Logging logs
Logs are a useful way to understand the behavior of your training code on the
cloud. When AI Platform runs a training job, it captures all
stdout
and stderr
streams and logging statements. These logs are stored in
Cloud Logging; they are visible both during and after execution.
The easiest way to find the logs for your job is to select your job in AI Platform > Jobs on Cloud Console, and then click "View logs".
If you leave "All logs" selected, you see all logs from all workers.
You can also select a specific task; master-replica-0
gives you an
overview of the job's execution from the master's perspective.
Because you selected verbose logging, you can inspect the full logging output.
Look for the term accuracy
in the logs for the AI Platform job.
If you want to view these logs in your terminal, you can do so from the command line with:
gcloud ai-platform jobs stream-logs $JOB_NAME
See all the options for gcloud ai-platform jobs stream-logs.
Inspect the summary logs using Tensorboard
You can inspect the behavior of your training job by launching TensorBoard and pointing it at the summary logs produced during training — both during and after execution.
Because the training programs write summaries directly to a Cloud Storage location, Tensorboard can automatically read from them without manual copying of event files.
macOS
Launch TensorBoard:
tensorboard --logdir=$OUTPUT_PATH
When you have started running TensorBoard, you can access it in your browser at http://localhost:6006
Cloud Shell
Launch TensorBoard:
tensorboard --logdir=$OUTPUT_PATH --port=8080
Select "Preview on port 8080" from the Web Preview menu at the top of the command line.
Click on Accuracy to see graphical representations of how accuracy changes as your job progresses.
You can shut down TensorBoard at any time by typing ctrl+c
on the
command line.
Run distributed training in the cloud
To take advantage of Google's scalable infrastructure when running training jobs, configure your training job to run in distributed mode.
No code changes are necessary to run this model as a distributed process in AI Platform.
To run a distributed job, set
--scale-tier
to any
tier above basic. For more information about scale tiers, see the
scale tier documentation.
Select a name for your distributed training job that distinguishes it from other training jobs. For example, you could use
dist
to represent distributed and a number to represent the iteration.JOB_NAME=census_dist_1
Specify
OUTPUT_PATH
to include the job name so that you don't inadvertently reuse checkpoints between jobs. You might have to redefineBUCKET_NAME
if you've started a new command-line session since you last defined it. For example, the followingOUTPUT_PATH
points to a directory namedcensus-dist-1
.OUTPUT_PATH=gs://$BUCKET_NAME/$JOB_NAME
Run the following command to submit a training job in the cloud that uses multiple workers. Note that the job can take a few minutes to start.
Place
--scale-tier
above the--
that separates the user arguments from the command-line arguments. For example, the following command uses a scale tier ofSTANDARD_1
:gcloud ai-platform jobs submit training $JOB_NAME \ --job-dir $OUTPUT_PATH \ --runtime-version 1.14 \ --python-version 2.7 \ --module-name trainer.task \ --package-path trainer/ \ --region $REGION \ --scale-tier STANDARD_1 \ -- \ --train-files $TRAIN_DATA \ --eval-files $EVAL_DATA \ --train-steps 1000 \ --verbosity DEBUG \ --eval-steps 100
You can monitor the progress of your job by watching the command-line output or in AI Platform > Jobs on Google Cloud Console.
Inspect the logs
Inspect the Cloud Logging logs and summary logs the same way that you did for the single-instance training job.
For Cloud Logging logs: Either select your job in AI Platform > Jobs on Cloud Console, and then click View logs or use the following command from your terminal:
gcloud ai-platform jobs stream-logs $JOB_NAME
For TensorBoard:
macOS
Launch TensorBoard:
tensorboard --logdir=$OUTPUT_PATH
When you have started running TensorBoard, you can access it in your browser a http://localhost:6006
Cloud Shell
Launch TensorBoard:
tensorboard --logdir=$OUTPUT_PATH --port=8080
Select "Preview on port 8080" from the Web Preview menu at the top of the command line.
Hyperparameter Tuning
AI Platform offers hyperparameter tuning to help you maximize
your model's predictive accuracy. The census sample stores the hyperparameter
configuration settings in a YAML file named hptuning_config.yaml
and includes
the file in the training request using the --config
variable.
Select a new job name and create a variable that references the configuration file.
HPTUNING_CONFIG=../hptuning_config.yaml JOB_NAME=census_core_hptune_1 TRAIN_DATA=gs://$BUCKET_NAME/data/adult.data.csv EVAL_DATA=gs://$BUCKET_NAME/data/adult.test.csv
Specify
OUTPUT_PATH
to include the job name so that you don't inadvertently reuse checkpoints between jobs. You might have to redefineBUCKET_NAME
if you've started a new command-line session since you last defined it. For example, the followingOUTPUT_PATH
points to a directory namedcensus_core_hptune_1
.OUTPUT_PATH=gs://$BUCKET_NAME/$JOB_NAME
Run the following command to submit a training job that not only uses multiple workers but also uses hyperparameter tuning.
gcloud ai-platform jobs submit training $JOB_NAME \ --stream-logs \ --job-dir $OUTPUT_PATH \ --runtime-version 1.14 \ --python-version 2.7 \ --config $HPTUNING_CONFIG \ --module-name trainer.task \ --package-path trainer/ \ --region $REGION \ --scale-tier STANDARD_1 \ -- \ --train-files $TRAIN_DATA \ --eval-files $EVAL_DATA \ --train-steps 1000 \ --verbosity DEBUG \ --eval-steps 100
For more information about hyperparameter tuning, see the hyperparameter tuning overview.
Deploy a model to support prediction
Choose a name for your model; this must start with a letter and contain only letters, numbers, and underscores. For example:
MODEL_NAME=census
Create an AI Platform model:
gcloud ai-platform models create $MODEL_NAME --regions=$REGION
Select the job output to use. The following sample uses the job named
census_dist_1
.OUTPUT_PATH=gs://$BUCKET_NAME/census_dist_1
Look up the full path of your exported trained model binaries:
gsutil ls -r $OUTPUT_PATH/export
Find a directory named
$OUTPUT_PATH/export/census/<timestamp>
and copy this directory path (without the : at the end) and set the environment variableMODEL_BINARIES
to its value. For example:MODEL_BINARIES=gs://$BUCKET_NAME/census_dist_1/export/census/1487877383942/
Where
$BUCKET_NAME
is your Cloud Storage bucket name, andcensus_dist_1
is the output directory.Run the following command to create a version
v1
:gcloud ai-platform versions create v1 \ --model $MODEL_NAME \ --origin $MODEL_BINARIES \ --runtime-version 1.14 \ --python-version 2.7
You can get a list of your models using the models list
command.
gcloud ai-platform models list
Send an online prediction request to a deployed model
You can now send prediction requests to your model. For example, the following
command sends an online prediction request using a test.json
file that you
downloaded as part of the sample GitHub repository.
gcloud ai-platform predict \
--model $MODEL_NAME \
--version v1 \
--json-instances ../test.json
The response includes the probabilities of each label (>50K and <=50K)
based on the data entry in test.json
, thus indicating whether the
predicted income is greater than or less than 50,000 dollars.
The response looks like this:
CLASSES PROBABILITIES [u'0', u'1'] [0.9969545602798462, 0.0030454816296696663]
Submit a batch prediction job
The batch prediction service is useful if you have large amounts of data and no latency requirements on receiving prediction results. This uses the same format as online prediction, but requires data be stored in Cloud Storage.
Set a name for the job.
JOB_NAME=census_prediction_1
Set the output path.
OUTPUT_PATH=gs://$BUCKET_NAME/$JOB_NAME
Submit the prediction job.
gcloud ai-platform jobs submit prediction $JOB_NAME \ --model $MODEL_NAME \ --version v1 \ --data-format text \ --region $REGION \ --input-paths $TEST_JSON \ --output-path $OUTPUT_PATH/predictions
Unlike the previous commands, this one returns immediately. Check the progress of the job and wait for it to finish:
gcloud ai-platform jobs describe $JOB_NAME
You should see state: SUCCEEDED
once the job completes; this may take several
minutes. You can also see the job logs in your terminal using
gcloud ai-platform jobs stream-logs $JOB_NAME
Alternatively, you can check the progress in AI Platform > Jobs on Cloud Console.
After the job succeeds, you can:
Read the output summary.
gsutil cat $OUTPUT_PATH/predictions/prediction.results-00000-of-00001
You should see output similar to the following.
{"probabilities": [0.9962924122810364, 0.003707568161189556], "logits": [-5.593664646148682], "classes": 0, "logistic": [0.003707568161189556]}
List the other files that the job produced using the
gsutil ls
command.gsutil ls -r $OUTPUT_PATH
Compared to online prediction, batch prediction:
- Is slower for this small number of instances (but is more suitable for large numbers of instances).
- May return output in a different order than the input (but the numeric index allows each output to be matched to its corresponding input instance; this is not necessary for online prediction since the outputs are returned in the same order as the original input instances).
After the predictions are available, the next step is usually to ingest these predictions into a database or data processing pipeline.
In this sample, you deployed the model before running the batch prediction, but it's possible to skip that step by specifying the model binaries URI when you submit the batch prediction job. One advantage of generating predictions from a model before deploying it is that you can evaluate the model's performance on different evaluation datasets to help you decide whether the model meets your criteria for deployment.
Cleaning up
If you've finished analyzing the output from your training and prediction runs, you can avoid incurring additional charges to your Google Cloud account for the Cloud Storage directories used in this guide:
Open a terminal window (if not already open).
Use the gsutil rm command with the -r flag to delete the directory that contains your most recent job:
gsutil rm -r gs://$BUCKET_NAME/$JOB_NAME
If successful, the command returns a message similar to this:
Removing gs://my-awesome-bucket/just-a-folder/cloud-storage.logo.png#1456530077282000... Removing gs://my-awesome-bucket/...
Repeat the command for any other directories that you created for this sample.
Alternatively, if you have no other data stored in the bucket, you can run the
gsutil rm -r
command on the bucket itself.
About the data
The Census Income Data Set that this sample uses for training is hosted by the UC Irvine Machine Learning Repository.
Census data courtesy of Lichman, M. (2013). UCI Machine Learning Repository http://archive.ics.uci.edu/ml. Irvine, CA: University of California, School of Information and Computer Science. This dataset is publicly available for anyone to use under the following terms provided by the Dataset Source - http://archive.ics.uci.edu/ml - and is provided "AS IS" without any warranty, express or implied, from Google. Google disclaims all liability for any damages, direct or indirect, resulting from the use of the dataset.
What's next
You've now completed a walkthrough of an AI Platform sample that uses census data for training and prediction. You validated the training job locally, ran it in the cloud in both single-instance and distributed mode, used hyperparameter tuning to improve the model, and used the model to get online and batch predictions.
The following resources can help you continue learning about AI Platform.
- Learn the basics of AI Platform.
- See how to use GPUs and Cloud TPU nodes to train your models on AI Platform.
- Follow an example that trains and predicts using low-level TensorFlow.