在 AWS Clean Rooms ML 中關聯設定的模型演算法 - AWS Clean Rooms

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

在 AWS Clean Rooms ML 中關聯設定的模型演算法

設定模型演算法之後,您就可以將模型演算法與協同合作建立關聯。與模型演算法建立關聯可讓協同合作的所有成員使用模型演算法。

下圖顯示建立容器訓練映像和設定模型演算法之後,將設定的模型演算法關聯為最後一個步驟。

如何貢獻自訂 ML 模型的概觀。
Console
建立自訂 ML 模型演算法的關聯 (主控台)
  1. 登入 AWS Management Console 並開啟位於 https://https://console.aws.amazon.com/cleanrooms 的 AWS Clean Rooms 主控台。

  2. 在左側導覽窗格中,選擇自訂 ML 模型

  3. 自訂 ML 模型頁面上,選擇您要與協同合作建立關聯的已設定模型演算法,然後按一下與協同合作建立關聯

  4. 關聯設定的模型演算法視窗中,選擇您要關聯的協同合作。

  5. 選擇選擇協同合作

API

建立自訂 ML 模型演算法 (API) 的關聯

使用特定參數執行下列程式碼。

您也可以提供隱私權政策,定義可存取不同日誌的人員、允許客戶定義 regex,以及可以從訓練模型輸出或推論結果匯出的資料量。

注意

設定的模型演算法關聯是不可變的。

import boto3 acr_ml_client= boto3.client('cleanroomsml') acr_ml_client.create_configured_model_algorithm_association( name='configured_model_algorithm_association_name', description='purpose of the association', membershipIdentifier='membership_id', configuredModelAlgorithmArn= 'arn:aws:cleanrooms-ml:region:account:membership/membershipIdentifier/configured-model-algorithm/identifier', privacyConfiguration = { "policies": { "trainedModels": { "containerLogs": [ { "allowedAccountIds": ['member_account_id'], }, { "allowedAccountIds": ['member_account_id'], "filterPattern": "INFO" } ], "containerMetrics": { "noiseLevel": 'noise value' } }, "trainedModelInferenceJobs": { "containerLogs": [ { "allowedAccountIds": ['member_account_id'] } ] }, trainedModelExports: { maxSize: { unit: GB, value: 5 }, filesToExport: [ "MODEL", // final model artifacts that container should write to /opt/ml/model directory "OUTPUT" // other artifacts that container should write to /opt/ml/output/data directory ] } } } )

在設定的模型演算法與協同合作相關聯後,訓練資料提供者必須將協同合作分析規則新增至其資料表。此規則允許設定的模型演算法關聯存取其設定的資料表。所有貢獻的訓練資料提供者都必須執行下列程式碼:

import boto3 acr_client= boto3.client('cleanrooms') acr_client.create_configured_table_association_analysis_rule( membershipIdentifier= 'membership_id', configuredTableAssociationIdentifier= 'configured_table_association_id', analysisRuleType= 'CUSTOM', analysisRulePolicy = { 'v1': { 'custom': { 'allowedAdditionalAnalyses': ['arn:aws:cleanrooms-ml:region:*:membership/*/configured-model-algorithm-association/*''], 'allowedResultReceivers': [] } } } )
注意

由於設定的模型演算法關聯是不可變的,因此建議訓練希望允許列出模型的資料提供者,以便在自訂模型組態的前幾次反覆allowedAdditionalAnalyses運算期間使用 中的萬用字元。這可讓模型提供者在其程式碼上反覆運算,而不需要其他訓練提供者在訓練更新後的模型程式碼與資料之前重新建立關聯。