建立實驗

本頁說明如何在 Colab Enterprise 中使用側邊面板,與 Vertex AI Experiments 互動。

如要在 Colab Enterprise 筆記本中執行程式碼,並存取 Google Cloud 服務和 API,可以使用與 Google 帳戶相關聯的憑證。詳情請參閱存取 Google Cloud 服務和 API

側邊面板是與 Vertex AI Experiments 互動的另一種方式,不必離開 Colab Enterprise 介面。

側邊面板會顯示在開啟的記事本右側。

開啟記事本後,右側側邊面板中的按鈕

事前準備

  1. Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
  2. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

  3. Verify that billing is enabled for your Google Cloud project.

  4. Enable the Vertex AI, Dataform, and Compute Engine APIs.

    Enable the APIs

  5. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

  6. Verify that billing is enabled for your Google Cloud project.

  7. Enable the Vertex AI, Dataform, and Compute Engine APIs.

    Enable the APIs

  8. 必要的角色

    如要取得在 Colab Enterprise 筆記本中使用側邊面板所需的權限,請要求管理員將專案的下列 IAM 角色授予您:

    如要進一步瞭解如何授予角色,請參閱「管理專案、資料夾和機構的存取權」。

    您或許還可透過自訂角色或其他預先定義的角色取得必要權限。

    Vertex AI Experiments

    Vertex AI Experiments 可讓您追蹤實驗執行的步驟、輸入內容和輸出內容,藉此追蹤及分析不同的模型架構、超參數和訓練環境。詳情請參閱 Vertex AI Experiments 簡介

    建立及查看實驗

    您可以在 Colab Enterprise 中使用側邊面板建立及查看實驗結果。

    1. 在 Google Cloud 控制台中,前往 Colab Enterprise 的「My notebooks」(我的筆記本) 頁面。

      前往「我的筆記本」

    2. 在「Region」(區域) 選單中,選取包含筆記本的區域。

    3. 按一下要開啟的筆記本。如果尚未建立筆記本,請建立筆記本

    4. 在筆記本右側的側邊面板中,按一下「實驗」按鈕

      側邊面板會展開「實驗」分頁。

    5. 按一下「插入程式碼範例」按鈕。

      Colab Enterprise 會在筆記本中新增程式碼儲存格,以便與實驗互動。

    6. 在筆記本中,找出儲存參數值的程式碼儲存格。 您將使用這些參數與 Vertex AI Experiments 互動。

    7. 更新下列參數的值:

      • PROJECT_ID:筆記本所在的專案 ID。
      • REGION:筆記本所在的區域。
      • BUCKET_URI:Cloud Storage 值區 URI,格式為 gs://BUCKET_NAME。可以是現有值區,也可以在執行程式碼時建立。這個 bucket 必須與 Colab Enterprise 筆記本位於相同專案和區域。
      • EXPERIMENT_NAME:實驗名稱。 如果實驗不存在,Vertex AI Experiments 會建立實驗。
    8. 如需建立 Cloud Storage bucket,請找出並取消註解下列程式碼行:

      # ! gcloud storage buckets create {BUCKET_URI} --location={REGION} --project={PROJECT_ID}
      
    9. 執行側邊面板新增至筆記本的程式碼儲存格。

    10. 最後一個程式碼儲存格執行完畢後,按一下顯示的「查看實驗」按鈕。

    11. 在側邊面板中,按一下「Runs」(執行) 分頁標籤或「Details」(詳細資料) 分頁標籤,查看實驗相關資訊。詳情請參閱「建立及管理實驗執行」。

    後續步驟