建立實驗
本頁面說明如何使用 Colab Enterprise 的側邊面板,與 Gemini Enterprise Agent Platform 上的實驗互動。
如要在 Colab Enterprise 筆記本中執行程式碼,並存取 Google Cloud 服務和 API,可以使用與 Google 帳戶相關聯的憑證。詳情請參閱「存取服務和 API」。 Google Cloud
側邊面板是與 Experiments on Agent Platform 互動的另一種方式,無須離開 Colab Enterprise 介面。
側邊面板會顯示在開啟的記事本右側。
事前準備
- 登入 Google Cloud 帳戶。如果您是 Google Cloud新手,歡迎 建立帳戶,親自評估產品在實際工作環境中的成效。新客戶還能獲得價值 $300 美元的免費抵免額,可用於執行、測試及部署工作負載。
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
Enable the Agent Platform, Dataform, and Compute Engine APIs.
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enablepermission. Learn how to grant roles.-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
Enable the Agent Platform, Dataform, and Compute Engine APIs.
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enablepermission. Learn how to grant roles.
必要的角色
如要取得在 Colab Enterprise 筆記本中使用側邊面板所需的權限,請要求管理員在專案中授予您下列 IAM 角色:
- Colab Enterprise 使用者 (
roles/aiplatform.colabEnterpriseUser) - Agent Platform 使用者 (
roles/aiplatform.user)
如要進一步瞭解如何授予角色,請參閱「管理專案、資料夾和組織的存取權」。
角色的使用者,可以使用 Dataform API 或 Dataform 指令列介面 (CLI),列出該專案中的程式碼資產名稱。使用 BigQuery Studio 的非管理員只能查看自己建立或與自己共用的程式碼資產。Agent Platform 的實驗功能
Agent Platform 的實驗功能可追蹤及分析不同的模型架構、超參數和訓練環境,讓您追蹤實驗執行的步驟、輸入內容和輸出內容。詳情請參閱「Agent Platform 實驗簡介」。
建立及查看實驗
您可以在 Colab Enterprise 中使用側邊面板建立實驗並查看結果。
-
前往 Google Cloud 控制台的 Colab Enterprise「我的筆記本」頁面。
-
在「Region」(區域) 選單中,選取包含筆記本的區域。
-
按一下要開啟的筆記本。如果尚未建立筆記本,請建立筆記本。
-
在筆記本右側的側邊面板中,按一下「實驗」按鈕 。
側邊面板會展開「實驗」分頁。
-
按一下「插入程式碼範例」按鈕。
Colab Enterprise 會在筆記本中新增程式碼儲存格,方便您與實驗互動。
-
在筆記本中,找出儲存參數值的程式碼儲存格。 您將使用這些參數與 Experiments on Agent Platform 互動。
-
更新下列參數的值:
-
PROJECT_ID:筆記本所在的專案 ID。 -
REGION:筆記本所在的區域。 -
BUCKET_URI:Cloud Storage bucket URI,格式為gs://BUCKET_NAME。可以是現有值區,也可以在執行程式碼時建立。這個 bucket 必須與 Colab Enterprise 筆記本位於相同專案和區域。 -
EXPERIMENT_NAME:實驗名稱。 如果實驗不存在,Experiments on Agent Platform 會建立一個。
-
-
如需建立 Cloud Storage bucket,請找出並取消註解下列程式碼行:
# ! gcloud storage buckets create {BUCKET_URI} --location={REGION} --project={PROJECT_ID} -
執行側邊面板新增至筆記本的程式碼儲存格。
-
最後一個程式碼儲存格執行完畢後,按一下顯示的「查看實驗」按鈕。
-
在側邊面板中,按一下「執行」分頁標籤或「詳細資料」分頁標籤,查看實驗相關資訊。詳情請參閱「建立及管理實驗執行」。
後續步驟
進一步瞭解 Agent Platform 上的實驗。
如要尋找可協助您快速啟動專案的筆記本,請參閱筆記本庫。