Table Of Contents

Feedback

User Guide

First time using the AWS CLI? See the User Guide for help getting started.

[ aws . sagemaker ]

create-hyper-parameter-tuning-job

Description

Starts a hyperparameter tuning job. A hyperparameter tuning job finds the best version of a model by running many training jobs on your dataset using the algorithm you choose and values for hyperparameters within ranges that you specify. It then chooses the hyperparameter values that result in a model that performs the best, as measured by an objective metric that you choose.

See also: AWS API Documentation

See 'aws help' for descriptions of global parameters.

Synopsis

  create-hyper-parameter-tuning-job
--hyper-parameter-tuning-job-name <value>
--hyper-parameter-tuning-job-config <value>
--training-job-definition <value>
[--warm-start-config <value>]
[--tags <value>]
[--cli-input-json <value>]
[--generate-cli-skeleton <value>]

Options

--hyper-parameter-tuning-job-name (string)

The name of the tuning job. This name is the prefix for the names of all training jobs that this tuning job launches. The name must be unique within the same AWS account and AWS Region. The name must have { } to { } characters. Valid characters are a-z, A-Z, 0-9, and : + = @ _ % - (hyphen). The name is not case sensitive.

--hyper-parameter-tuning-job-config (structure)

The HyperParameterTuningJobConfig object that describes the tuning job, including the search strategy, the objective metric used to evaluate training jobs, ranges of parameters to search, and resource limits for the tuning job. For more information, see automatic-model-tuning

JSON Syntax:

{
  "Strategy": "Bayesian",
  "HyperParameterTuningJobObjective": {
    "Type": "Maximize"|"Minimize",
    "MetricName": "string"
  },
  "ResourceLimits": {
    "MaxNumberOfTrainingJobs": integer,
    "MaxParallelTrainingJobs": integer
  },
  "ParameterRanges": {
    "IntegerParameterRanges": [
      {
        "Name": "string",
        "MinValue": "string",
        "MaxValue": "string"
      }
      ...
    ],
    "ContinuousParameterRanges": [
      {
        "Name": "string",
        "MinValue": "string",
        "MaxValue": "string"
      }
      ...
    ],
    "CategoricalParameterRanges": [
      {
        "Name": "string",
        "Values": ["string", ...]
      }
      ...
    ]
  },
  "TrainingJobEarlyStoppingType": "Off"|"Auto"
}

--training-job-definition (structure)

The HyperParameterTrainingJobDefinition object that describes the training jobs that this tuning job launches, including static hyperparameters, input data configuration, output data configuration, resource configuration, and stopping condition.

JSON Syntax:

{
  "StaticHyperParameters": {"string": "string"
    ...},
  "AlgorithmSpecification": {
    "TrainingImage": "string",
    "TrainingInputMode": "Pipe"|"File",
    "AlgorithmName": "string",
    "MetricDefinitions": [
      {
        "Name": "string",
        "Regex": "string"
      }
      ...
    ]
  },
  "RoleArn": "string",
  "InputDataConfig": [
    {
      "ChannelName": "string",
      "DataSource": {
        "S3DataSource": {
          "S3DataType": "ManifestFile"|"S3Prefix"|"AugmentedManifestFile",
          "S3Uri": "string",
          "S3DataDistributionType": "FullyReplicated"|"ShardedByS3Key",
          "AttributeNames": ["string", ...]
        }
      },
      "ContentType": "string",
      "CompressionType": "None"|"Gzip",
      "RecordWrapperType": "None"|"RecordIO",
      "InputMode": "Pipe"|"File",
      "ShuffleConfig": {
        "Seed": long
      }
    }
    ...
  ],
  "VpcConfig": {
    "SecurityGroupIds": ["string", ...],
    "Subnets": ["string", ...]
  },
  "OutputDataConfig": {
    "KmsKeyId": "string",
    "S3OutputPath": "string"
  },
  "ResourceConfig": {
    "InstanceType": "ml.m4.xlarge"|"ml.m4.2xlarge"|"ml.m4.4xlarge"|"ml.m4.10xlarge"|"ml.m4.16xlarge"|"ml.m5.large"|"ml.m5.xlarge"|"ml.m5.2xlarge"|"ml.m5.4xlarge"|"ml.m5.12xlarge"|"ml.m5.24xlarge"|"ml.c4.xlarge"|"ml.c4.2xlarge"|"ml.c4.4xlarge"|"ml.c4.8xlarge"|"ml.p2.xlarge"|"ml.p2.8xlarge"|"ml.p2.16xlarge"|"ml.p3.2xlarge"|"ml.p3.8xlarge"|"ml.p3.16xlarge"|"ml.c5.xlarge"|"ml.c5.2xlarge"|"ml.c5.4xlarge"|"ml.c5.9xlarge"|"ml.c5.18xlarge",
    "InstanceCount": integer,
    "VolumeSizeInGB": integer,
    "VolumeKmsKeyId": "string"
  },
  "StoppingCondition": {
    "MaxRuntimeInSeconds": integer
  },
  "EnableNetworkIsolation": true|false,
  "EnableInterContainerTrafficEncryption": true|false
}

--warm-start-config (structure)

Specifies the configuration for starting the hyperparameter tuning job using one or more previous tuning jobs as a starting point. The results of previous tuning jobs are used to inform which combinations of hyperparameters to search over in the new tuning job.

All training jobs launched by the new hyperparameter tuning job are evaluated by using the objective metric. If you specify IDENTICAL_DATA_AND_ALGORITHM as the WarmStartType value for the warm start configuration, the training job that performs the best in the new tuning job is compared to the best training jobs from the parent tuning jobs. From these, the training job that performs the best as measured by the objective metric is returned as the overall best training job.

Note

All training jobs launched by parent hyperparameter tuning jobs and the new hyperparameter tuning jobs count against the limit of training jobs for the tuning job.

Shorthand Syntax:

ParentHyperParameterTuningJobs=[{HyperParameterTuningJobName=string},{HyperParameterTuningJobName=string}],WarmStartType=string

JSON Syntax:

{
  "ParentHyperParameterTuningJobs": [
    {
      "HyperParameterTuningJobName": "string"
    }
    ...
  ],
  "WarmStartType": "IdenticalDataAndAlgorithm"|"TransferLearning"
}

--tags (list)

An array of key-value pairs. You can use tags to categorize your AWS resources in different ways, for example, by purpose, owner, or environment. For more information, see AWS Tagging Strategies .

Tags that you specify for the tuning job are also added to all training jobs that the tuning job launches.

Shorthand Syntax:

Key=string,Value=string ...

JSON Syntax:

[
  {
    "Key": "string",
    "Value": "string"
  }
  ...
]

--cli-input-json (string) Performs service operation based on the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, the CLI values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally.

--generate-cli-skeleton (string) Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command.

See 'aws help' for descriptions of global parameters.

Output

HyperParameterTuningJobArn -> (string)

The Amazon Resource Name (ARN) of the tuning job. Amazon SageMaker assigns an ARN to a hyperparameter tuning job when you create it.