Review the services and steps involved in hosting custom machine learning models on container clusters on GCP.
- [Instructor] As we get started understanding the steps involved in building a custom machine learning model, I want to refer you to this documentation that Google has around building a serverless machine learning model. Now, the title is a little bit of a misnomer, in that you're actually using containers, but you're using a service where Google helps you to manage those containers. So when we're thinking about the type of machine learning services, we're now looking at hosting our model either in what I call raw containers, in other words, you create the container and then you manage the container, or we can use a new service from Google called Cloud Machine Learning Engine.
In this case, containers are being used, but there are some optimizations, particularly around machine learning life cycle. These include splitting training and prediction. Training typically has a much higher compute demand, and so Google efficiently scales that section separate from the prediction. So as we're thinking about hosting custom machine learning models in containers, we really have two choices. And I would recommend that you first take a look at Machine Learning Engine, because of the split between training and prediction.
Now, when you're working with ML Engine, you still have to consider which type of algorithm you want to use, so supervised or unsupervised, as we talked about earlier, and also traditional or modern. We're going to take a look an example with TensorFlow shortly. We also want to consider data preparation and model hyperparameter tuning. Now Google will help us with some of those steps, which can save significant time in model creation and deployment. As an alternative to ML Engine, if you need more control, you can create your own custom Docker container.
Now if you do this, then you're going to have to have quite a lot of control around the infrastructure. You're gonna have to document it, and you're gonna have to also document the Kubernetes, or the container management. You'll have to set up, monitor, and size the cluster virtual machines that host Kubernetes and the Docker containers, and you'll have to size the k8, or Kubernetes cluster. Also, if you set up your own containers, you'll have to set up security token management.
If you choose to use Cloud ML Engine, you have four different types of algorithm frameworks to choose from. You can choose TensorFlow, or the higher level language Keras. You can choose from many but not all of the algorithms in scikit-learn, or you can choose XGBoost. The steps involved in developing a custom ML model using Google services are as follows. First you'll start with a dataset stored in cloud storage. Often you'll then use a Cloud Datalab Jupyter notebook to design your model.
You'll use ML Engine for the training, and the output will be a model. ML Engine will also handle the deployment. A typical pattern is to invoke the endpoint using a cloud function.
- Hosting options: Serverless, containers, and virtual machines
- Enabling the GCP ML AIs
- Preparing data with Cloud Dataflow and Dataprep
- Modeling predictions for images, video, text to speech, and cloud translation
- Machine learning with AutoML
- Advanced machine learning and deep learning
- Machine learning architectures