Compare commits

...
Author SHA1 Message Date
ivanmkc@google.com 5679e46a12 Addressed TW comments 2023-03-07 12:01:41 -05:00
ivanmkc@google.com d54b3845fe Fixed notebooks/official/ml_metadata/sdk-metric-parameter-tracking-for-locally-trained-models.ipynb 2023-03-07 10:45:42 -05:00
ivanmkc@google.com be20a635e4 Fixed missing dependency 2023-03-07 08:42:35 -05:00
ivanmkc@google.com b42b6c6fb8 Added missing cells 2023-03-06 23:34:27 -05:00
ivanmkc@google.com 73fbc762fe Added tqdm to requirements.txt 2023-03-06 20:00:53 -05:00
ivanmkc@google.com 994a86d07a Fixed bugs 2023-03-06 16:53:46 -05:00
ivanmkc@google.com 71c1eca210 Fixed predictions 2023-03-06 16:16:39 -05:00
ivanmkc@google.com 1c431bdb85 Updated links 2023-03-06 14:41:50 -05:00
ivanmkc@google.com 096a5d069e Linted 2023-03-06 14:38:29 -05:00
ivanmkc@google.com 3ade1ab265 Added stackoverflow embeddings notebook 2023-03-06 10:45:06 -05:00
Andrew FerlitschandGitHub 8593308244 Merge pull request #1569 from ninataneja/final-doc-change
Update dashboard instructions
2023-03-03 22:29:28 +00:00
Nina Taneja 806801b4ea Fix print error 2023-03-03 21:15:33 +00:00
Nina Taneja 3acd72ec81 Fix lint error 2023-03-03 20:49:42 +00:00
Nina Taneja 12347f3ce2 Add error handling for delete job 2023-03-03 20:45:29 +00:00
Nina Taneja f9c4e32088 Add sleep for async job 2023-03-03 20:11:00 +00:00
Nina Taneja 78da2206b0 Update dashboard instructions 2023-03-03 18:50:21 +00:00
gericdongandGitHub 46fa993732 Merge pull request #1559 from GoogleCloudPlatform/ml_ops_registry
feat: add notebook for model versioning
2023-03-03 18:43:05 +00:00
Andrew FerlitschandGitHub df0c0d209b Merge pull request #1568 from kthytang/fs-integration
feat: notebook for prediction feature store integration
2023-03-03 18:32:05 +00:00
kthytang 2e8d6239df chore: run python3.9 -m tensorflow_docs.tools.nbfmt --remove_outputs "$notebook" 2023-03-03 10:02:46 -08:00
Andrew Ferlitsch 1841201fee fix: dep issue 2023-03-03 17:20:44 +00:00
kthytang f10857f299 chore: address comments 2023-03-03 07:17:50 -08:00
kthytang e3bcff62fc chore: fix lint 2023-03-02 14:18:47 -08:00
kthytang ce3a439d06 feat: notebook for prediction feature store integration 2023-03-02 14:04:38 -08:00
Andrew FerlitschandGitHub b47d4b46f3 Merge pull request #1567 from GoogleCloudPlatform/reznitskii-patch-12
Fixed typo
2023-03-02 21:40:56 +00:00
Andrew FerlitschandGitHub 1cc87860c4 Merge pull request #1566 from GoogleCloudPlatform/reznitskii-patch-11
Fixed typo and link
2023-03-02 21:40:06 +00:00
reznitskiiandGitHub 5d6aa4479d Update automl_video_classification_model_evaluation.ipynb 2023-03-02 15:11:07 -05:00
reznitskiiandGitHub 5a25b06f2d Update UJ14 Vertex SDK AutoML Video Classification.ipynb 2023-03-02 15:09:45 -05:00
Andrew Ferlitsch bb055ed061 fix: cleanup 2023-03-02 18:26:45 +00:00
Andrew FerlitschandGitHub 974610a555 Merge pull request #1562 from GoogleCloudPlatform/reznitskii-patch-8
Updated link
2023-03-02 08:25:51 +00:00
Andrew FerlitschandGitHub d78574e640 Merge pull request #1565 from ninataneja/dask-sdk
Add SDK support for Dask dashboard to Training
2023-03-02 08:25:22 +00:00
Nina Taneja ff367ae9f5 Fixed formatting problem 2023-03-02 01:34:46 +00:00
Nina Taneja 40b5e74645 Addressed formatting and wording changes 2023-03-02 01:26:52 +00:00
Nina Taneja dee509e8d7 Add SDK support for Dask dashboard to Training 2023-03-01 23:39:06 +00:00
Andrew Ferlitsch fd5921fa32 fix: invalid alias 2023-03-01 22:55:39 +00:00
reznitskiiandGitHub c74a44a4a8 Update sdk_automl_tabular_classification_online_explain.ipynb 2023-03-01 17:22:30 -05:00
Andrew FerlitschandGitHub 367c985642 Merge pull request #1560 from GoogleCloudPlatform/autoindex_tensorboard
fix: tensorboard branding
2023-03-01 22:03:24 +00:00
Andrew Ferlitsch f7a970e15b fix: TIMESTAMP 2023-03-01 21:53:51 +00:00
Andrew Ferlitsch 9a914a5af4 fix: tensorboard branding 2023-03-01 21:46:57 +00:00
Andrew Ferlitsch e5315be85a feat: add notebook for model versioning 2023-03-01 20:54:17 +00:00
Andrew FerlitschandGitHub 6daf663a69 Merge pull request #1557 from GoogleCloudPlatform/custom_eval
feat: notebook for custom evaluations
2023-03-01 20:15:56 +00:00
gericdongandGitHub 4aec14c576 Merge pull request #1558 from GoogleCloudPlatform/andrewferlitsch-patch-4
tmp file added by mistake
2023-03-01 18:34:45 +00:00
Andrew FerlitschandGitHub f7d4d3a9c3 tmp file added by mistake 2023-03-01 10:08:20 -08:00
Andrew FerlitschandGitHub ab1e97ac18 Merge pull request #1553 from GoogleCloudPlatform/autoindex_max_3
fix: 5 branding bugs
2023-03-01 16:04:23 +00:00
Andrew FerlitschandGitHub 78630ae2c0 Merge pull request #1552 from GoogleCloudPlatform/reznitskii-patch-3
Fixed typo
2023-03-01 16:03:51 +00:00
Andrew Ferlitsch 93e9fbac92 fix: 5 branding bugs 2023-02-28 20:42:03 +00:00
Andrew FerlitschandGitHub 231b2ef02b Merge pull request #1556 from GoogleCloudPlatform/reznitskii-patch-6
Fixed typo
2023-02-28 20:40:04 +00:00
Andrew FerlitschandGitHub 7132c12831 Merge pull request #1555 from GoogleCloudPlatform/reznitskii-patch-5
Fixed typos
2023-02-28 20:31:30 +00:00
reznitskiiandGitHub 2b547e8279 Update forecasting-retail-demand.ipynb 2023-02-28 15:24:25 -05:00
reznitskiiandGitHub 8b84524244 Update ai-explanations-tabnet-algorithm.ipynb 2023-02-28 15:21:53 -05:00
Andrew Ferlitsch 60fe1bd2c6 fix: 5 branding bugs 2023-02-28 20:16:57 +00:00
reznitskiiandGitHub 0edea80ffa Update custom_tabular_regression_model_evaluation.ipynb 2023-02-28 15:02:47 -05:00
Yvonne LiandGitHub 493e50a999 Merge pull request #1550 from GoogleCloudPlatform/autoindex_max_2
fix: extra period in link
2023-02-28 19:50:08 +00:00
Andrew Ferlitsch 8440e7f164 fix: extra period in link 2023-02-28 19:44:33 +00:00
14 changed files with 3968 additions and 24 deletions
+1
View File
@@ -11,3 +11,4 @@ google-cloud-storage
google-cloud-build
ratemate
GitPython
tqdm
+5 -1
View File
@@ -1153,7 +1153,7 @@ def add_index(path: str,
if linkbacks[_].startswith("vertex-ai"):
print(f' Learn more about <a href="https://cloud.google.com/{linkbacks[_]}" target="_blank">{replace_cl(tags[_])}</a>.\n')
else:
print(f' Learn more about <a href="{linkbacks[_]}." target="_blank">{replace_cl(tags[_])}</a>.\n')
print(f' Learn more about <a href="{linkbacks[_]}" target="_blank">{replace_cl(tags[_])}</a>.\n')
if args.steps:
print("<devsite-expandable>\n")
@@ -1240,6 +1240,8 @@ def replace_cl(text : str ) -> str:
'Vertex AI Prediction': '{{vertex_prediction_name}}',
'Vertex TensorBoard': '{{vertex_tensorboard_name}}',
'Vertex AI TensorBoard': '{{vertex_tensorboard_name}}',
'TensorBoard': '{{vertex_tensorboard_name}}',
'Tensorboard': '{{vertex_tensorboard_name}}',
'Vertex ML Metadata': '{{vertex_metadata_name}}',
'Vertex Pipelines': '{{vertex_pipelines_name}}',
'Vertex AI Pipelines': '{{vertex_pipelines_name}}',
@@ -1265,6 +1267,8 @@ def replace_cl(text : str ) -> str:
'Vertex AI': '{{vertex_ai_name}}',
'Cloud Storage': '{{storage_name}}',
'GCS': '{{storage_name}}',
'GCP': '{{gcp_name}}',
'TensorFlow Enterprise': '{{tf4gcp_name}}',
'TensorFlow': '{{tensorflow_name}}',
}
@@ -147,8 +147,7 @@
"# Install the packages\n",
"! pip3 install --upgrade google-cloud-aiplatform \\\n",
" google-cloud-storage \\\n",
" google-cloud-bigquery \\\n",
" pyarrow"
" 'google-cloud-bigquery[pandas]'"
]
},
{
@@ -632,12 +631,12 @@
" df_train_x, df_train_y = df_train, df_train.pop(LABEL_COLUMN)\n",
" df_validation_x, df_validation_y = df_validation, df_validation.pop(LABEL_COLUMN)\n",
"\n",
" y_train = np.asarray(df_train_y).astype(\"float32\")\n",
" y_validation = np.asarray(df_validation_y).astype(\"float32\")\n",
" y_train = tf.convert_to_tensor(np.asarray(df_train_y).astype(\"float32\"))\n",
" y_validation = tf.convert_to_tensor(np.asarray(df_validation_y).astype(\"float32\"))\n",
"\n",
" # Convert to numpy representation\n",
" x_train = np.asarray(df_train_x) \n",
" x_test = np.asarray(df_validation_x)\n",
" x_train = tf.convert_to_tensor(np.asarray(df_train_x).astype(\"float32\"))\n",
" x_test = tf.convert_to_tensor(np.asarray(df_validation_x).astype(\"float32\"))\n",
"\n",
" # Convert to one-hot representation\n",
" num_species = len(df_train_y.unique())\n",
@@ -735,7 +734,7 @@
" display_name=JOB_NAME,\n",
" script_path=\"task.py\",\n",
" container_uri=\"us-docker.pkg.dev/vertex-ai/training/tf-cpu.2-8:latest\",\n",
" requirements=[\"google-cloud-bigquery>=2.20.0\", \"db-dtypes\"],\n",
" requirements=[\"google-cloud-bigquery[pandas]\", \"protobuf<3.20.0\"],\n",
" model_serving_container_image_uri=\"us-docker.pkg.dev/vertex-ai/prediction/tf2-cpu.2-8:latest\",\n",
")\n",
"\n",
@@ -64,7 +64,7 @@
"\n",
"This tutorial demonstrates how to use the Vertex AI SDK to create tabular classification models and do online prediction with explanation using a Google Cloud [AutoML](https://cloud.google.com/vertex-ai/docs/start/automl-users) model.\n",
"\n",
"Learn more about [AutoML Tabular](https://cloud.google.com/vertex-ai/docs/tabular-data/overview) and [Vertex Explainable AI](https://cloud.google.com/vertex-ai/docs/explainable-ai/overview)."
"Learn more about [Classification for tabular data](https://cloud.google.com/vertex-ai/docs/tabular-data/classification-regression/overview) and [Vertex Explainable AI](https://cloud.google.com/vertex-ai/docs/explainable-ai/overview)."
]
},
{
@@ -29,7 +29,7 @@
"id": "title:migration,new"
},
"source": [
"# Vertex AI: Vertex AI Migration: AutoML Video Classificaton\n",
"# Vertex AI: Vertex AI Migration: AutoML Video Classification\n",
"\n",
"<table align=\"left\">\n",
"\n",
@@ -64,7 +64,7 @@
"\n",
"This tutorial demonstrates how to use the Vertex AI SDK for Python to train a AutoML video classification model and do a batch prediction.\n",
"\n",
"Learn more about [Migrate to Vertex AI](https://cloud.google.com/vertex-ai/docs/start/migrating-to-vertex-ai) and [AutoML Video](https://cloud.google.com/vertex-ai/docs/tutorials/video-classification-automl/training)."
"Learn more about [Migrate to Vertex AI](https://cloud.google.com/vertex-ai/docs/start/migrating-to-vertex-ai) and [Classification for video data](https://cloud.google.com/vertex-ai/docs/training-overview#classification_for_videos)."
]
},
{
@@ -140,7 +140,7 @@
"outputs": [],
"source": [
"! pip install --upgrade -q google-cloud-aiplatform \\\n",
" tensorflow==2.8 -q"
" tensorflow -q"
]
},
{
@@ -92,7 +92,7 @@
"- Train a Automl Video Classification model on the `Vertex AI Dataset` resource.\n",
"- Import the trained `AutoML Vertex AI Model resource` into the pipeline.\n",
"- Run a batch prediction job inside the pipeline.\n",
"- Evaulate the AutoML model using the classification evaluation component.\n",
"- Evaluate the AutoML model using the classification evaluation component.\n",
"- Import the classification metrics to the AutoML Vertex AI Model resource."
]
},
@@ -93,7 +93,7 @@
"- Upload the model as a Vertex AI Model resource.\n",
"- Import a pre-trained `Vertex AI model resource` into the pipeline.\n",
"- Run a `batch prediction` job in the pipeline.\n",
"- Evaulate the model using the `regression evaluation component`.\n",
"- Evaluate the model using the `regression evaluation component`.\n",
"- Import the Regression Metrics to the Vertex AI model resource."
]
},
File diff suppressed because it is too large Load Diff
@@ -29,7 +29,7 @@
"id": "JAPoU8Sm5E6e"
},
"source": [
"# Vertex AI Explainations with TabNet models\n",
"# Vertex AI Explanations with TabNet models\n",
"\n",
"<table align=\"left\">\n",
"\n",
@@ -86,7 +86,7 @@
"- TabNet builtin algorithm\n",
"\n",
"The steps performed are:\n",
"* Setup the the project.\n",
"* Setup the project.\n",
"* Download the prediction data of pretrain model onf Syn2 data.\n",
"* Visualize and understand the feature importance based on the masks output.\n",
"* Clean up the resource created by this tutorial."
@@ -830,13 +830,22 @@
" ! gcloud builds submit --timeout=1800s --region={REGION} --tag $TRAIN_IMAGE"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "41ZgDYPNfEvt"
},
"source": [
"## Run training job with SDK (Option 1) or with gcloud (Option 2)"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "PtUycdZhCJvQ"
},
"source": [
"### Initialize Vertex AI SDK"
"### 1.1 Initialize Vertex AI SDK"
]
},
{
@@ -860,7 +869,16 @@
"id": "_GB2j39BCXiy"
},
"source": [
"### Run a Vertex AI SDK CustomContainerTrainingJob"
"### 1.2 Run a Vertex AI SDK CustomContainerTrainingJob"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "7udaU3jxfKs8"
},
"source": [
"You can specify the fields enable_web_access and enable_dashboard_access. The enable_web_access enables the interactive shell for the job and enable_dashboard_access allows the dask dashboard to be accessed."
]
},
{
@@ -887,9 +905,34 @@
" base_output_dir=gcs_output_uri_prefix,\n",
" replica_count=replica_count,\n",
" machine_type=machine_type,\n",
" enable_dashboard_access=True,\n",
" enable_web_access=True,\n",
" sync=False,\n",
")"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "ROqdvgBKFGKL"
},
"source": [
"Wait for a few minutes for the Custom Job to start"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "rBYbvim_FJz0"
},
"outputs": [],
"source": [
"import time\n",
"\n",
"time.sleep(60 * 3)"
]
},
{
"cell_type": "code",
"execution_count": null,
@@ -902,13 +945,66 @@
"print(f\"GCS Output URI Prefix: {gcs_output_uri_prefix}\")"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "-0EJdcjPyjDK"
},
"source": [
"You can access the link to the Custom Job in the Cloud Console UI here:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "ZMZPrcqsyj0e"
},
"outputs": [],
"source": [
"print(\n",
" f\"Custom Training Job URI: {custom_container_training_job._custom_job_console_uri()}\"\n",
")"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "7McPKJGxymLU"
},
"source": [
"Once the job is in the state \"RUNNING\", you can access the web access and dashboard access URIs here:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "tiHdwJs1yoE0"
},
"outputs": [],
"source": [
"print(f\"Web Access and Dashboard URIs: {custom_container_training_job.web_access_uris}\")"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "9RDh5CzNywIA"
},
"source": [
"The interactive shell has the key with the format \"workerpool0-0\", while the dashboard uri has the key with the format \"workerpool0-0:\" + port number (workerpool0-0:8888 in this example). On the page for your Custom Job in the Cloud Console UI, you can also \"Launch web terminal\" for \"workerpool0-0\" for web access, or click \"Launch web terminal\" for \"workerpool0-0:\" + port number for dashboard access.\n",
"\n",
"Note that you can only access an interactive shell and dashboard while the job is running. If you don't see Launch web terminal in the UI or the URIs in the output of the Web Access and Dashboard URIs command, this might be because Vertex AI hasn't started running your job yet, or because the job has already finished or failed. If the job's Status is Queued or Pending, wait a minute; then try refreshing the page, or trying the command again."
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "tVktIbToRpmR"
},
"source": [
"### Access the Dask dashboard"
"### 2. Run a CustomContainerTraining Job with gcloud"
]
},
{
@@ -917,7 +1013,7 @@
"id": "uVvxLj8GRsM6"
},
"source": [
"You can also create a training job with gcloud command. With gcloud command, you can specify the field enableWebAccess and enableDashboardAccess. enableWebAccess enables the interactive shell for the job and enableDashboardAccess allows the dask dashboard to be accessed."
"You can also create a training job with the gcloud command. With the gcloud command, you can specify the field enableWebAccess and enableDashboardAccess. The enableWebAccess enables the interactive shell for the job and enableDashboardAccess allows the dask dashboard to be accessed."
]
},
{
@@ -975,10 +1071,16 @@
{
"cell_type": "markdown",
"metadata": {
"id": "onb40Ge0SVKh"
"id": "HAYihHT9ff9q"
},
"source": [
"Once the job is created. You can use the output `gcloud ai custom-jobs describe` command to print the field webAccessUris. The interactive shell has the key with the format \"workerpool0-0\", while the dashboard uri has the key with the format \"workerpool0-0:\" + port number. Note: You have to access the links while the job is running."
"#### Access the dashboard and interactive shell for a gcloud custom job\n",
"\n",
"Once the job is created, you can access the web access URI and dashboard access URI by using the `gcloud ai custom-jobs describe` command to print the field webAccessUris. The interactive shell has the key with the format \"workerpool0-0\", while the dashboard uri has the key with the format \"workerpool0-0:\" + port number (workerpool0-0:8888 in this example).\n",
"\n",
"You also can find the links in the Cloud Console UI. In the Cloud Console UI, in the Vertex AI section, go to Training and then Custom Jobs. Click on the name of your custom training job. On the page for your job, click \"Launch web terminal\" for \"workerpool0-0\" for web access, or click \"Launch web terminal\" for \"workerpool0-0:\" + port number for dashboard access.\n",
"\n",
"Note that you can only access an interactive shell and dashboard while the job is running. If you don't see Launch web terminal in the UI or the URIs in the output of the gcloud command, this might be because Vertex AI hasn't started running your job yet, or because the job has already finished or failed. If the job's Status is Queued or Pending, wait a minute; then try refreshing the page, or trying the gcloud command again."
]
},
{
@@ -1098,6 +1200,9 @@
},
"outputs": [],
"source": [
"import logging\n",
"import traceback\n",
"\n",
"# Set this to true only if you'd like to delete your bucket\n",
"delete_bucket = False\n",
"\n",
@@ -1106,7 +1211,11 @@
"if delete_bucket or os.getenv(\"IS_TESTING\"):\n",
" ! gsutil rm -r $BUCKET_URI\n",
"\n",
"custom_container_training_job.delete()"
"try:\n",
" custom_container_training_job.delete()\n",
"except Exception as e:\n",
" logging.error(traceback.format_exc())\n",
" print(e)"
]
}
],
@@ -89,7 +89,7 @@
"* Model with BigQuery and the ARIMA model\n",
"* Evaluate the model\n",
"* Evaluate the model results using BigQuery ML (on training data)\n",
"* Evalute the model results - MAE, MAPE, MSE, RMSE (on test data)\n",
"* Evaluate the model results - MAE, MAPE, MSE, RMSE (on test data)\n",
"* Use the executor feature"
]
},