fix: bad links and objective (#1090)

* fix: objective conformance

* fix: objective conformance

* fix: objective conformance

* fix: objective conformance

* fix: objective conformance
This commit is contained in:
Andrew Ferlitsch
2022-10-05 10:07:35 -07:00
committed by GitHub
parent 0747f9efb8
commit 0e773ba90f
4 changed files with 2254 additions and 2135 deletions
@@ -29,26 +29,33 @@
"id": "JAPoU8Sm5E6e"
},
"source": [
"<table align=\"left\">\n",
"# Introduction to builtin Swivel embedding algorithm\n",
"\n",
"<table align=\"left\">\n",
" <td>\n",
" <a href=\"https://colab.research.google.com/github/GoogleCloudPlatform/vertex-ai-samples/blob/master/notebooks/official/matching_engine/intro-swivel.ipynb\"\">\n",
" <a href=\"https://colab.research.google.com/github/GoogleCloudPlatform/vertex-ai-samples/blob/main/notebooks/official/matching_engine/intro-swivel.ipynb\">\n",
" <img src=\"https://cloud.google.com/ml-engine/images/colab-logo-32px.png\" alt=\"Colab logo\"> Run in Colab\n",
" </a>\n",
" </td>\n",
" <td>\n",
" <a href=\"https://github.com/GoogleCloudPlatform/vertex-ai-samples/blob/master/notebooks/official/matching_engine/intro-swivel.ipynb\">\n",
" <a href=\"https://github.com/GoogleCloudPlatform/vertex-ai-samples/blob/main/notebooks/official/matching_engine/intro-swivel.ipynb\">\n",
" <img src=\"https://cloud.google.com/ml-engine/images/github-logo-32px.png\" alt=\"GitHub logo\">\n",
" View on GitHub\n",
" </a>\n",
" </td>\n",
" <td>\n",
" <a href=\"https://console.cloud.google.com/vertex-ai/workbench/deploy-notebook?download_url=https://raw.githubusercontent.com/GoogleCloudPlatform/vertex-ai-samples/main/notebooks/official/matching_engine/intro-swivel.ipynb\">\n",
" <img src=\"https://lh3.googleusercontent.com/UiNooY4LUgW_oTvpsNhPpQzsstV5W8F7rYgxgGBD85cWJoLmrOzhVs_ksK_vgx40SHs7jCqkTkCk=e14-rj-sc0xffffff-h130-w32\" alt=\"Vertex AI logo\">\n",
" Open in Vertex AI Workbench\n",
" </a>\n",
" </td>\n",
"</table>"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "tvgnzT1CKxrO"
"id": "0f2a285ac113"
},
"source": [
"## Overview\n",
@@ -61,26 +68,47 @@
"\n",
"It will require you provide a bucket where the dataset will be stored.\n",
"\n",
"Note: you may incur charges for training, storage or usage of other GCP products (Dataflow) in connection with testing this SDK.\n",
"Note: you may incur charges for training, storage or usage of other GCP products (Dataflow) in connection with testing this SDK.\n"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "tvgnzT1CKxrO"
},
"source": [
"### Objective\n",
"\n",
"In this notebook, you learn how to train custom embeddings using Vertex AI Pipelines and deploy the model for serving. The steps performed include:\n",
"\n",
"1. **Setup**: Importing the required libraries and setting your global variables.\n",
"2. **Configure parameters**: Setting the appropriate parameter values for the pipeline job.\n",
"3. **Train on Vertex AI Pipelines**: Create a Swivel job to Vertex Pipelines using pipeline template.\n",
"4. **Deploy on Vertex AI Prediction**: Importing and deploying the trained model to a callable endpoint.\n",
"5. **Predict**: Calling the deployed endpoint using online prediction.\n",
"6. **Cleaning up**: Deleting resources created by this tutorial."
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "fdba765f512d"
},
"source": [
"### Dataset\n",
"\n",
"You will use the following sample datasets in the public bucket **gs://cloud-samples-data/vertex-ai/matching-engine/swivel**:\n",
"\n",
"1. **movielens_25m**: A [movie rating dataset](https://grouplens.org/datasets/movielens/25m/) for the items input type that you can use to create embeddings for movies. This dataset is processed so that each line contains the movies that have same rating by the same user. The directory also includes `movies.csv`, which maps the movie ids to their names.\n",
"2. **wikipedia**: A text corpus dataset created from a [Wikipedia dump](https://dumps.wikimedia.org/enwiki/) that you can use to create word embeddings.\n",
"\n",
"### Objective\n",
"\n",
"In this notebook, you will learn how to train custom embeddings using Vertex Pipelines and deploy the model for serving. The steps performed include:\n",
"\n",
"1. **Setup**: Importing the required libraries and setting your global variables.\n",
"2. **Configure parameters**: Setting the appropriate parameter values for the pipeline job.\n",
"3. **Train on Vertex Pipelines**: Create a Swivel job to Vertex Pipelines using pipeline template.\n",
"4. **Deploy on Vertex Prediction**: Importing and deploying the trained model to a callable endpoint.\n",
"5. **Predict**: Calling the deployed endpoint using online prediction.\n",
"6. **Cleaning up**: Deleting resources created by this tutorial.\n",
"\n",
"2. **wikipedia**: A text corpus dataset created from a [Wikipedia dump](https://dumps.wikimedia.org/enwiki/) that you can use to create word embeddings."
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "f0c48754d30e"
},
"source": [
"### Costs \n",
"\n",
"This tutorial uses billable components of Google Cloud:\n",
@@ -29,51 +29,78 @@
"id": "JAPoU8Sm5E6e"
},
"source": [
"<table align=\"left\">\n",
"# Introduction to builtin Two-towers embedding algorithm\n",
"\n",
"<table align=\"left\">\n",
" <td>\n",
" <a href=\"https://colab.research.google.com/github/GoogleCloudPlatform/vertex-ai-samples/blob/master/notebooks/official/matching_engine/two-tower-model-introduction.ipynb\"\">\n",
" <a href=\"https://colab.research.google.com/github/GoogleCloudPlatform/vertex-ai-samples/blob/main/notebooks/official/matching_engine/two-tower-model-introduction.ipynb\">\n",
" <img src=\"https://cloud.google.com/ml-engine/images/colab-logo-32px.png\" alt=\"Colab logo\"> Run in Colab\n",
" </a>\n",
" </td>\n",
" <td>\n",
" <a href=\"https://github.com/GoogleCloudPlatform/vertex-ai-samples/tree/master/notebooks/official/matching_engine/two-tower-model-introduction.ipynb\">\n",
" <a href=\"https://github.com/GoogleCloudPlatform/vertex-ai-samples/blob/main/notebooks/official/matching_engine/two-tower-model-introduction.ipynb\">\n",
" <img src=\"https://cloud.google.com/ml-engine/images/github-logo-32px.png\" alt=\"GitHub logo\">\n",
" View on GitHub\n",
" </a>\n",
" </td>\n",
" <td>\n",
" <a href=\"https://console.cloud.google.com/vertex-ai/workbench/deploy-notebook?download_url=https://raw.githubusercontent.com/GoogleCloudPlatform/vertex-ai-samples/main/notebooks/official/matching_engine/two-tower-model-introduction.ipynb\">\n",
" <img src=\"https://lh3.googleusercontent.com/UiNooY4LUgW_oTvpsNhPpQzsstV5W8F7rYgxgGBD85cWJoLmrOzhVs_ksK_vgx40SHs7jCqkTkCk=e14-rj-sc0xffffff-h130-w32\" alt=\"Vertex AI logo\">\n",
" Open in Vertex AI Workbench\n",
" </a>\n",
" </td>\n",
"</table>"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "tvgnzT1CKxrO"
"id": "2b352e8fb437"
},
"source": [
"## Overview\n",
"\n",
"This tutorial demonstrates how to use the Two-Tower built-in algorithm on the Vertex AI platform.\n",
"\n",
"Two-tower models learn to represent two items of various types (such as user profiles, search queries, web documents, answer passages, or images) in the same vector space, so that similar or related items are close to each other. These two items are referred to as the query and candidate object, since when paired with a nearest neighbor search service such as Vertex Matching Engine, the two-tower model can retrieve candidate objects related to an input query object. These objects are encoded by a query and candidate encoder (the two \"towers\") respectively, which are trained on pairs of relevant items. This built-in algorithm exports trained query and candidate encoders as model artifacts, which can be deployed in Vertex Prediction for usage in a recommendation system.\n",
"\n",
"### Dataset\n",
"\n",
"This tutorial uses the `movielens_100k sample dataset` in the public bucket `gs://cloud-samples-data/vertex-ai/matching-engine/two-tower`, which was generated from the [MovieLens movie rating dataset](https://grouplens.org/datasets/movielens/100k/). For simplicity, the data for this tutorial only includes the user id feature for users, and the movie id and movie title features for movies. In this example, the user is the query object and the movie is the candidate object, and each training example in the dataset contains a user and a movie they rated (we only include positive ratings in the dataset). The two-tower model will embed the user and the movie in the same embedding space, so that given a user, the model will recommend movies it thinks the user will like.\n",
"\n",
"Two-tower models learn to represent two items of various types (such as user profiles, search queries, web documents, answer passages, or images) in the same vector space, so that similar or related items are close to each other. These two items are referred to as the query and candidate object, since when paired with a nearest neighbor search service such as Vertex Matching Engine, the two-tower model can retrieve candidate objects related to an input query object. These objects are encoded by a query and candidate encoder (the two \"towers\") respectively, which are trained on pairs of relevant items. This built-in algorithm exports trained query and candidate encoders as model artifacts, which can be deployed in Vertex Prediction for usage in a recommendation system.\n"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "tvgnzT1CKxrO"
},
"source": [
"### Objective\n",
"\n",
"In this notebook, you will learn how to run the two-tower model.\n",
"In this notebook, you learn how to run the two-tower model.\n",
"The tutorial covers the following steps:\n",
"1. **Setup**: Importing the required libraries and setting your global variables.\n",
"2. **Configure parameters**: Setting the appropriate parameter values for the training job.\n",
"3. **Train on Vertex Training**: Submitting a training job.\n",
"4. **Deploy on Vertex Prediction**: Importing and deploying the trained model to a callable endpoint.\n",
"3. **Train on Vertex AI Training**: Submitting a training job.\n",
"4. **Deploy on Vertex AI Prediction**: Importing and deploying the trained model to a callable endpoint.\n",
"5. **Predict**: Calling the deployed endpoint using online or batch prediction.\n",
"6. **Hyperparameter tuning**: Running a hyperparameter tuning job.\n",
"7. **Cleaning up**: Deleting resources created by this tutorial.\n",
"\n",
"7. **Cleaning up**: Deleting resources created by this tutorial."
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "812ec4e27d66"
},
"source": [
"### Dataset\n",
"\n",
"This tutorial uses the `movielens_100k sample dataset` in the public bucket `gs://cloud-samples-data/vertex-ai/matching-engine/two-tower`, which was generated from the [MovieLens movie rating dataset](https://grouplens.org/datasets/movielens/100k/). For simplicity, the data for this tutorial only includes the user id feature for users, and the movie id and movie title features for movies. In this example, the user is the query object and the movie is the candidate object, and each training example in the dataset contains a user and a movie they rated (we only include positive ratings in the dataset). The two-tower model will embed the user and the movie in the same embedding space, so that given a user, the model will recommend movies it thinks the user will like."
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "0c997d8d92ce"
},
"source": [
"### Costs \n",
"\n",
"\n",
File diff suppressed because it is too large Load Diff