在 Google AI Platform 超参数调整中更改 trialId

Change trialId in Google AI Platform hyperparameter tuning

我正在尝试按照本教程学习如何在 AI Platform 上调整超参数:https://cloud.google.com/blog/products/gcp/hyperparameter-tuning-on-google-cloud-platform-is-now-faster-and-smarter

我的配置 yaml 文件如下所示:

trainingInput:
  hyperparameters:
    goal: MINIMIZE
    hyperparameterMetricTag: loss
    maxTrials: 4
    maxParallelTrials: 2
    params:
      - parameterName: learning_rate
        type: DISCRETE
        discreteValues:
        - 0.0005
        - 0.001
        - 0.0015
        - 0.002

预期输出:

  "completedTrialCount": "4",
  "trials": [
    {
      "trialId": "3",
      "hyperparameters": {
        "learning_rate": "2e-03"
      },
      "finalMetric": {
        "trainingStep": "123456",
        "objectiveValue": 0.123456
      },
    },

有什么方法可以自定义 trialId 而不是默认数值(例如 1,2,3,4...)?

无法自定义 trialId,因为它取决于超参数调整配置中的参数 maxTrials

maxTrials 只接受整数,因此分配给 trialId 的值将是从 1 到您定义的 maxTrials.

的范围

也如 example in your post 中所述,其中设置了 maxTrials: 40,它会产生一个 json,显示 trialId: 35maxTrials 的范围内.

This indicates that 40 trials have been completed, and the best so far is trial 35, which achieved an objective of 1.079 with the hyperparameter values of nembeds=18 and nnsize=32.

示例输出: