TensorFlow Colab notebooks
-
Custom training with TPUs
This shows how to create a model with Keras but customize the training loop. This way you get the benefit of writing a model in the simple Keras API, but still retain the flexibility by allowing you to train the model with a custom loop.
-
MNIST with Keras and TPU
This is a canonical end-to-end TPU sample in Keras, featuring data loading with tf.data.Dataset, the Keras model, TPU training, TPU inference and also trained model export to the Tensorflow standard "saved model" format, model deployment to ML Engine, and predictions from the cloud-deployed model.
-
Fashion MNIST with Keras and TPU
This notebook demonstrates an end-to-end image classification sample with data loading, TPU training, model export, and deployment.
-
MNIST Estimator to TPUEstimator
This notebook demonstrates how to port a MNIST Estimator model to TPUEstimator. Every line that needed changing is commented. The baseline Estimator model is in the "MNIST with Estimator" notebook.
-
MNIST with Estimator
This is a baseline before porting to TPUEstimator. The ported version is in the "MNIST Estimator to TPUEstimator" notebook.
-
Train embeddings on TPU with Autoencoder
This colab explores how to train autoencoders on a TPU device.
-
Classification of flowers using Keras
This notebook demonstrates how to train, evaluate, and generate predictions using Keras with Cloud TPUs. It uses the iris dataset to predict the species of the flower and also shows how to use your own data instead of using pre-loaded data.
-
Classification of flowers using TPUEstimator
This notebook demonstrates how to train, evaluate, and generate predictions using TPUEstimator with Cloud TPUs. It uses the iris dataset to predict the species of the flower and also shows how to use your own data instead of using pre-loaded data.
-
Shakespeare with Keras and TPU
This notebook uses Keras to build a language model and train it on a Cloud TPU. This language model predicts the next character of text given the text so far. The trained model can generate new snippets of text that read in a similar style to the text training data.
-
Shakespeare with TPUEstimator
This notebook uses TPUEstimator to build a language model and train it on a Cloud TPU. This language model predicts the next character of text given the text so far. The trained model can generate new snippets of text that read in a similar style to the text training data.
-
Sine regression with Keras
This notebook demonstrates using Cloud TPUs to build a simple regression model using y = sin(x) to predict y for given x.
-
Fine tuning tasks in 5 minutes with BERT and Cloud TPU
This notebook demonstrates using a free Colab Cloud TPU to fine-tune sentence and sentence-pair classification tasks built on top of pretrained BERT models.
-
Training Generative Adversarial Networks on TPUs using TF-GAN.
This notebook uses TPUs to train a GAN on the CIFAR10 dataset. The model learns to generate images of airplanes, cars, birds, cats, deer, dogs, frogs, horses, ships, and trucks.
PyTorch Colab notebooks
-
PyTorch/TPU MNIST Demo
This colab example corresponds to the implementation under test_train_mnist.py and is TF/XRT 1.15 compatible.
-
PyTorch/TPU ResNet18/CIFAR10 Demo
This colab example corresponds to the implementation under test_train_cifar.py and is TF/XRT 1.15 compatible.
-
PyTorch/TPU ResNet50 Inference Demo
This colab example is TF/XRT 1.15 compatible.