建立實驗

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

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

側邊面板是另一種與 Vertex AI Experiments 互動的方式,無須離開 Colab Enterprise 介面即可操作。

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

已開啟的 Notebook 右側側邊面板上的按鈕

事前準備

  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. Make sure 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. Make sure 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. 在 Notebook 右側的側邊面板中,按一下「Experiments」按鈕。

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

    5. 按一下「Insert sample code」按鈕。

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

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

    7. 更新下列參數的值:

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

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

    10. 最後一個程式碼儲存格執行完畢後,請點選畫面上顯示的 「View experiment」按鈕。

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

    後續步驟