Amazon SageMaker Service

2019/01/10 - Amazon SageMaker Service - 4 updated api methods

Changes  Update sagemaker client to latest version

CreateHyperParameterTuningJob (updated) Link ¶
Changes (request)
{'TrainingJobDefinition': {'EnableInterContainerTrafficEncryption': 'boolean'}}

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

Request Syntax

client.create_hyper_parameter_tuning_job(
    HyperParameterTuningJobName='string',
    HyperParameterTuningJobConfig={
        'Strategy': 'Bayesian',
        'HyperParameterTuningJobObjective': {
            'Type': 'Maximize'|'Minimize',
            'MetricName': 'string'
        },
        'ResourceLimits': {
            'MaxNumberOfTrainingJobs': 123,
            'MaxParallelTrainingJobs': 123
        },
        'ParameterRanges': {
            'IntegerParameterRanges': [
                {
                    'Name': 'string',
                    'MinValue': 'string',
                    'MaxValue': 'string'
                },
            ],
            'ContinuousParameterRanges': [
                {
                    'Name': 'string',
                    'MinValue': 'string',
                    'MaxValue': 'string'
                },
            ],
            'CategoricalParameterRanges': [
                {
                    'Name': 'string',
                    'Values': [
                        'string',
                    ]
                },
            ]
        },
        'TrainingJobEarlyStoppingType': 'Off'|'Auto'
    },
    TrainingJobDefinition={
        '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': 123
                }
            },
        ],
        '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': 123,
            'VolumeSizeInGB': 123,
            'VolumeKmsKeyId': 'string'
        },
        'StoppingCondition': {
            'MaxRuntimeInSeconds': 123
        },
        'EnableNetworkIsolation': True|False,
        'EnableInterContainerTrafficEncryption': True|False
    },
    WarmStartConfig={
        'ParentHyperParameterTuningJobs': [
            {
                'HyperParameterTuningJobName': 'string'
            },
        ],
        'WarmStartType': 'IdenticalDataAndAlgorithm'|'TransferLearning'
    },
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
)
type HyperParameterTuningJobName

string

param HyperParameterTuningJobName

[REQUIRED]

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.

type HyperParameterTuningJobConfig

dict

param HyperParameterTuningJobConfig

[REQUIRED]

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

  • Strategy (string) -- [REQUIRED]

    Specifies the search strategy for hyperparameters. Currently, the only valid value is Bayesian .

  • HyperParameterTuningJobObjective (dict) -- [REQUIRED]

    The HyperParameterTuningJobObjective object that specifies the objective metric for this tuning job.

    • Type (string) -- [REQUIRED]

      Whether to minimize or maximize the objective metric.

    • MetricName (string) -- [REQUIRED]

      The name of the metric to use for the objective metric.

  • ResourceLimits (dict) -- [REQUIRED]

    The ResourceLimits object that specifies the maximum number of training jobs and parallel training jobs for this tuning job.

    • MaxNumberOfTrainingJobs (integer) -- [REQUIRED]

      The maximum number of training jobs that a hyperparameter tuning job can launch.

    • MaxParallelTrainingJobs (integer) -- [REQUIRED]

      The maximum number of concurrent training jobs that a hyperparameter tuning job can launch.

  • ParameterRanges (dict) -- [REQUIRED]

    The ParameterRanges object that specifies the ranges of hyperparameters that this tuning job searches.

    • IntegerParameterRanges (list) --

      The array of IntegerParameterRange objects that specify ranges of integer hyperparameters that a hyperparameter tuning job searches.

      • (dict) --

        For a hyperparameter of the integer type, specifies the range that a hyperparameter tuning job searches.

        • Name (string) -- [REQUIRED]

          The name of the hyperparameter to search.

        • MinValue (string) -- [REQUIRED]

          The minimum value of the hyperparameter to search.

        • MaxValue (string) -- [REQUIRED]

          The maximum value of the hyperparameter to search.

    • ContinuousParameterRanges (list) --

      The array of ContinuousParameterRange objects that specify ranges of continuous hyperparameters that a hyperparameter tuning job searches.

      • (dict) --

        A list of continuous hyperparameters to tune.

        • Name (string) -- [REQUIRED]

          The name of the continuous hyperparameter to tune.

        • MinValue (string) -- [REQUIRED]

          The minimum value for the hyperparameter. The tuning job uses floating-point values between this value and MaxValue for tuning.

        • MaxValue (string) -- [REQUIRED]

          The maximum value for the hyperparameter. The tuning job uses floating-point values between MinValue value and this value for tuning.

    • CategoricalParameterRanges (list) --

      The array of CategoricalParameterRange objects that specify ranges of categorical hyperparameters that a hyperparameter tuning job searches.

      • (dict) --

        A list of categorical hyperparameters to tune.

        • Name (string) -- [REQUIRED]

          The name of the categorical hyperparameter to tune.

        • Values (list) -- [REQUIRED]

          A list of the categories for the hyperparameter.

          • (string) --

  • TrainingJobEarlyStoppingType (string) --

    Specifies whether to use early stopping for training jobs launched by the hyperparameter tuning job. This can be one of the following values (the default value is OFF ):

    OFF

    Training jobs launched by the hyperparameter tuning job do not use early stopping.

    AUTO

    Amazon SageMaker stops training jobs launched by the hyperparameter tuning job when they are unlikely to perform better than previously completed training jobs. For more information, see Stop Training Jobs Early.

type TrainingJobDefinition

dict

param TrainingJobDefinition

[REQUIRED]

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.

  • StaticHyperParameters (dict) --

    Specifies the values of hyperparameters that do not change for the tuning job.

    • (string) --

      • (string) --

  • AlgorithmSpecification (dict) -- [REQUIRED]

    The HyperParameterAlgorithmSpecification object that specifies the resource algorithm to use for the training jobs that the tuning job launches.

    • TrainingImage (string) --

      The registry path of the Docker image that contains the training algorithm. For information about Docker registry paths for built-in algorithms, see Algorithms Provided by Amazon SageMaker: Common Parameters.

    • TrainingInputMode (string) -- [REQUIRED]

      The input mode that the algorithm supports: File or Pipe. In File input mode, Amazon SageMaker downloads the training data from Amazon S3 to the storage volume that is attached to the training instance and mounts the directory to the Docker volume for the training container. In Pipe input mode, Amazon SageMaker streams data directly from Amazon S3 to the container.

      If you specify File mode, make sure that you provision the storage volume that is attached to the training instance with enough capacity to accommodate the training data downloaded from Amazon S3, the model artifacts, and intermediate information.

      For more information about input modes, see Algorithms.

    • AlgorithmName (string) --

      The name of the resource algorithm to use for the hyperparameter tuning job. If you specify a value for this parameter, do not specify a value for TrainingImage .

    • MetricDefinitions (list) --

      An array of MetricDefinition objects that specify the metrics that the algorithm emits.

      • (dict) --

        Specifies a metric that the training algorithm writes to stderr or stdout . Amazon SageMakerhyperparameter tuning captures all defined metrics. You specify one metric that a hyperparameter tuning job uses as its objective metric to choose the best training job.

        • Name (string) -- [REQUIRED]

          The name of the metric.

        • Regex (string) -- [REQUIRED]

          A regular expression that searches the output of a training job and gets the value of the metric. For more information about using regular expressions to define metrics, see Defining Objective Metrics.

  • RoleArn (string) -- [REQUIRED]

    The Amazon Resource Name (ARN) of the IAM role associated with the training jobs that the tuning job launches.

  • InputDataConfig (list) --

    An array of Channel objects that specify the input for the training jobs that the tuning job launches.

    • (dict) --

      A channel is a named input source that training algorithms can consume.

      • ChannelName (string) -- [REQUIRED]

        The name of the channel.

      • DataSource (dict) -- [REQUIRED]

        The location of the channel data.

        • S3DataSource (dict) -- [REQUIRED]

          The S3 location of the data source that is associated with a channel.

          • S3DataType (string) -- [REQUIRED]

            If you choose S3Prefix , S3Uri identifies a key name prefix. Amazon SageMaker uses all objects that match the specified key name prefix for model training.

            If you choose ManifestFile , S3Uri identifies an object that is a manifest file containing a list of object keys that you want Amazon SageMaker to use for model training.

            If you choose AugmentedManifestFile , S3Uri identifies an object that is an augmented manifest file in JSON lines format. This file contains the data you want to use for model training. AugmentedManifestFile can only be used if the Channel's input mode is Pipe .

          • S3Uri (string) -- [REQUIRED]

            Depending on the value specified for the S3DataType , identifies either a key name prefix or a manifest. For example:

            • A key name prefix might look like this: s3://bucketname/exampleprefix .

            • A manifest might look like this: s3://bucketname/example.manifest The manifest is an S3 object which is a JSON file with the following format: [ {"prefix": "s3://customer_bucket/some/prefix/"}, "relative/path/to/custdata-1", "relative/path/custdata-2", ... ] The preceding JSON matches the following s3Uris : s3://customer_bucket/some/prefix/relative/path/to/custdata-1 s3://customer_bucket/some/prefix/relative/path/custdata-2 ... The complete set of s3uris in this manifest is the input data for the channel for this datasource. The object that each s3uris points to must be readable by the IAM role that Amazon SageMaker uses to perform tasks on your behalf.

          • S3DataDistributionType (string) --

            If you want Amazon SageMaker to replicate the entire dataset on each ML compute instance that is launched for model training, specify FullyReplicated .

            If you want Amazon SageMaker to replicate a subset of data on each ML compute instance that is launched for model training, specify ShardedByS3Key . If there are n ML compute instances launched for a training job, each instance gets approximately 1/n of the number of S3 objects. In this case, model training on each machine uses only the subset of training data.

            Don't choose more ML compute instances for training than available S3 objects. If you do, some nodes won't get any data and you will pay for nodes that aren't getting any training data. This applies in both File and Pipe modes. Keep this in mind when developing algorithms.

            In distributed training, where you use multiple ML compute EC2 instances, you might choose ShardedByS3Key . If the algorithm requires copying training data to the ML storage volume (when TrainingInputMode is set to File ), this copies 1/n of the number of objects.

          • AttributeNames (list) --

            A list of one or more attribute names to use that are found in a specified augmented manifest file.

            • (string) --

      • ContentType (string) --

        The MIME type of the data.

      • CompressionType (string) --

        If training data is compressed, the compression type. The default value is None . CompressionType is used only in Pipe input mode. In File mode, leave this field unset or set it to None.

      • RecordWrapperType (string) --

        Specify RecordIO as the value when input data is in raw format but the training algorithm requires the RecordIO format. In this case, Amazon SageMaker wraps each individual S3 object in a RecordIO record. If the input data is already in RecordIO format, you don't need to set this attribute. For more information, see Create a Dataset Using RecordIO.

        In File mode, leave this field unset or set it to None.

      • InputMode (string) --

        (Optional) The input mode to use for the data channel in a training job. If you don't set a value for InputMode , Amazon SageMaker uses the value set for TrainingInputMode . Use this parameter to override the TrainingInputMode setting in a AlgorithmSpecification request when you have a channel that needs a different input mode from the training job's general setting. To download the data from Amazon Simple Storage Service (Amazon S3) to the provisioned ML storage volume, and mount the directory to a Docker volume, use File input mode. To stream data directly from Amazon S3 to the container, choose Pipe input mode.

        To use a model for incremental training, choose File input model.

      • ShuffleConfig (dict) --

        A configuration for a shuffle option for input data in a channel. If you use S3Prefix for S3DataType , this shuffles the results of the S3 key prefix matches. If you use ManifestFile , the order of the S3 object references in the ManifestFile is shuffled. If you use AugmentedManifestFile , the order of the JSON lines in the AugmentedManifestFile is shuffled. The shuffling order is determined using the Seed value.

        For Pipe input mode, shuffling is done at the start of every epoch. With large datasets this ensures that the order of the training data is different for each epoch, it helps reduce bias and possible overfitting. In a multi-node training job when ShuffleConfig is combined with S3DataDistributionType of ShardedByS3Key , the data is shuffled across nodes so that the content sent to a particular node on the first epoch might be sent to a different node on the second epoch.

        • Seed (integer) -- [REQUIRED]

          Determines the shuffling order in ShuffleConfig value.

  • VpcConfig (dict) --

    The VpcConfig object that specifies the VPC that you want the training jobs that this hyperparameter tuning job launches to connect to. Control access to and from your training container by configuring the VPC. For more information, see Protect Training Jobs by Using an Amazon Virtual Private Cloud.

    • SecurityGroupIds (list) -- [REQUIRED]

      The VPC security group IDs, in the form sg-xxxxxxxx. Specify the security groups for the VPC that is specified in the Subnets field.

      • (string) --

    • Subnets (list) -- [REQUIRED]

      The ID of the subnets in the VPC to which you want to connect your training job or model.

      • (string) --

  • OutputDataConfig (dict) -- [REQUIRED]

    Specifies the path to the Amazon S3 bucket where you store model artifacts from the training jobs that the tuning job launches.

    • KmsKeyId (string) --

      The AWS Key Management Service (AWS KMS) key that Amazon SageMaker uses to encrypt the model artifacts at rest using Amazon S3 server-side encryption. The KmsKeyId can be any of the following formats:

      • // KMS Key ID "1234abcd-12ab-34cd-56ef-1234567890ab"

      • // Amazon Resource Name (ARN) of a KMS Key "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"

      • // KMS Key Alias "alias/ExampleAlias"

      • // Amazon Resource Name (ARN) of a KMS Key Alias "arn:aws:kms:us-west-2:111122223333:alias/ExampleAlias"

      If you don't provide a KMS key ID, Amazon SageMaker uses the default KMS key for Amazon S3 for your role's account. For more information, see KMS-Managed Encryption Keys in the Amazon Simple Storage Service Developer Guide.

      The KMS key policy must grant permission to the IAM role that you specify in your CreateTramsformJob request. For more information, see Using Key Policies in AWS KMS in the AWS Key Management Service Developer Guide .

    • S3OutputPath (string) -- [REQUIRED]

      Identifies the S3 path where you want Amazon SageMaker to store the model artifacts. For example, s3://bucket-name/key-name-prefix .

  • ResourceConfig (dict) -- [REQUIRED]

    The resources, including the compute instances and storage volumes, to use for the training jobs that the tuning job launches.

    Storage volumes store model artifacts and incremental states. Training algorithms might also use storage volumes for scratch space. If you want Amazon SageMaker to use the storage volume to store the training data, choose File as the TrainingInputMode in the algorithm specification. For distributed training algorithms, specify an instance count greater than 1.

    • InstanceType (string) -- [REQUIRED]

      The ML compute instance type.

    • InstanceCount (integer) -- [REQUIRED]

      The number of ML compute instances to use. For distributed training, provide a value greater than 1.

    • VolumeSizeInGB (integer) -- [REQUIRED]

      The size of the ML storage volume that you want to provision.

      ML storage volumes store model artifacts and incremental states. Training algorithms might also use the ML storage volume for scratch space. If you want to store the training data in the ML storage volume, choose File as the TrainingInputMode in the algorithm specification.

      You must specify sufficient ML storage for your scenario.

      Note

      Amazon SageMaker supports only the General Purpose SSD (gp2) ML storage volume type.

    • VolumeKmsKeyId (string) --

      The AWS Key Management Service (AWS KMS) key that Amazon SageMaker uses to encrypt data on the storage volume attached to the ML compute instance(s) that run the training job. The VolumeKmsKeyId can be any of the following formats:

      • // KMS Key ID "1234abcd-12ab-34cd-56ef-1234567890ab"

      • // Amazon Resource Name (ARN) of a KMS Key "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"

  • StoppingCondition (dict) -- [REQUIRED]

    Sets a maximum duration for the training jobs that the tuning job launches. Use this parameter to limit model training costs.

    To stop a job, Amazon SageMaker sends the algorithm the SIGTERM signal. This delays job termination for 120 seconds. Algorithms might use this 120-second window to save the model artifacts.

    When Amazon SageMaker terminates a job because the stopping condition has been met, training algorithms provided by Amazon SageMaker save the intermediate results of the job.

    • MaxRuntimeInSeconds (integer) --

      The maximum length of time, in seconds, that the training job can run. If model training does not complete during this time, Amazon SageMaker ends the job. If value is not specified, default value is 1 day. Maximum value is 28 days.

  • EnableNetworkIsolation (boolean) --

    Isolates the training container. No inbound or outbound network calls can be made, except for calls between peers within a training cluster for distributed training. If network isolation is used for training jobs that are configured to use a VPC, Amazon SageMaker downloads and uploads customer data and model artifacts through the specified VPC, but the training container does not have network access.

    Note

    The Semantic Segmentation built-in algorithm does not support network isolation.

  • EnableInterContainerTrafficEncryption (boolean) --

    To encrypt all communications between ML compute instances in distributed training, specify True . Encryption provides greater security for distributed training, but training take longer because of the additional communications between ML compute instances.

type WarmStartConfig

dict

param WarmStartConfig

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.

  • ParentHyperParameterTuningJobs (list) -- [REQUIRED]

    An array of hyperparameter tuning jobs that are used as the starting point for the new hyperparameter tuning job. For more information about warm starting a hyperparameter tuning job, see Using a Previous Hyperparameter Tuning Job as a Starting Point.

    Hyperparameter tuning jobs created before October 1, 2018 cannot be used as parent jobs for warm start tuning jobs.

    • (dict) --

      A previously completed or stopped hyperparameter tuning job to be used as a starting point for a new hyperparameter tuning job.

      • HyperParameterTuningJobName (string) --

        The name of the hyperparameter tuning job to be used as a starting point for a new hyperparameter tuning job.

  • WarmStartType (string) -- [REQUIRED]

    Specifies one of the following:

    IDENTICAL_DATA_AND_ALGORITHM

    The new hyperparameter tuning job uses the same input data and training image as the parent tuning jobs. You can change the hyperparameter ranges to search and the maximum number of training jobs that the hyperparameter tuning job launches. You cannot use a new version of the training algorithm, unless the changes in the new version do not affect the algorithm itself. For example, changes that improve logging or adding support for a different data format are allowed. You can also change hyperparameters from tunable to static, and from static to tunable, but the total number of static plus tunable hyperparameters must remain the same as it is in all parent jobs. The objective metric for the new tuning job must be the same as for all parent jobs.

    TRANSFER_LEARNING

    The new hyperparameter tuning job can include input data, hyperparameter ranges, maximum number of concurrent training jobs, and maximum number of training jobs that are different than those of its parent hyperparameter tuning jobs. The training image can also be a different version from the version used in the parent hyperparameter tuning job. You can also change hyperparameters from tunable to static, and from static to tunable, but the total number of static plus tunable hyperparameters must remain the same as it is in all parent jobs. The objective metric for the new tuning job must be the same as for all parent jobs.

type Tags

list

param Tags

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.

  • (dict) --

    Describes a tag.

    • Key (string) -- [REQUIRED]

      The tag key.

    • Value (string) -- [REQUIRED]

      The tag value.

rtype

dict

returns

Response Syntax

{
    'HyperParameterTuningJobArn': 'string'
}

Response Structure

  • (dict) --

    • 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.

CreateTrainingJob (updated) Link ¶
Changes (request)
{'EnableInterContainerTrafficEncryption': 'boolean'}

Starts a model training job. After training completes, Amazon SageMaker saves the resulting model artifacts to an Amazon S3 location that you specify.

If you choose to host your model using Amazon SageMaker hosting services, you can use the resulting model artifacts as part of the model. You can also use the artifacts in a deep learning service other than Amazon SageMaker, provided that you know how to use them for inferences.

In the request body, you provide the following:

  • AlgorithmSpecification - Identifies the training algorithm to use.

  • HyperParameters - Specify these algorithm-specific parameters to influence the quality of the final model. For a list of hyperparameters for each training algorithm provided by Amazon SageMaker, see Algorithms.

  • InputDataConfig - Describes the training dataset and the Amazon S3 location where it is stored.

  • OutputDataConfig - Identifies the Amazon S3 location where you want Amazon SageMaker to save the results of model training.

  • ResourceConfig - Identifies the resources, ML compute instances, and ML storage volumes to deploy for model training. In distributed training, you specify more than one instance.

  • RoleARN - The Amazon Resource Number (ARN) that Amazon SageMaker assumes to perform tasks on your behalf during model training. You must grant this role the necessary permissions so that Amazon SageMaker can successfully complete model training.

  • StoppingCondition - Sets a duration for training. Use this parameter to cap model training costs.

For more information about Amazon SageMaker, see How It Works.

See also: AWS API Documentation

Request Syntax

client.create_training_job(
    TrainingJobName='string',
    HyperParameters={
        'string': 'string'
    },
    AlgorithmSpecification={
        'TrainingImage': 'string',
        'AlgorithmName': 'string',
        'TrainingInputMode': 'Pipe'|'File',
        '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': 123
            }
        },
    ],
    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': 123,
        'VolumeSizeInGB': 123,
        'VolumeKmsKeyId': 'string'
    },
    VpcConfig={
        'SecurityGroupIds': [
            'string',
        ],
        'Subnets': [
            'string',
        ]
    },
    StoppingCondition={
        'MaxRuntimeInSeconds': 123
    },
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ],
    EnableNetworkIsolation=True|False,
    EnableInterContainerTrafficEncryption=True|False
)
type TrainingJobName

string

param TrainingJobName

[REQUIRED]

The name of the training job. The name must be unique within an AWS Region in an AWS account.

type HyperParameters

dict

param HyperParameters

Algorithm-specific parameters that influence the quality of the model. You set hyperparameters before you start the learning process. For a list of hyperparameters for each training algorithm provided by Amazon SageMaker, see Algorithms.

You can specify a maximum of 100 hyperparameters. Each hyperparameter is a key-value pair. Each key and value is limited to 256 characters, as specified by the Length Constraint .

  • (string) --

    • (string) --

type AlgorithmSpecification

dict

param AlgorithmSpecification

[REQUIRED]

The registry path of the Docker image that contains the training algorithm and algorithm-specific metadata, including the input mode. For more information about algorithms provided by Amazon SageMaker, see Algorithms. For information about providing your own algorithms, see Using Your Own Algorithms with Amazon SageMaker.

  • TrainingImage (string) --

    The registry path of the Docker image that contains the training algorithm. For information about docker registry paths for built-in algorithms, see Algorithms Provided by Amazon SageMaker: Common Parameters.

  • AlgorithmName (string) --

    The name of the algorithm resource to use for the training job. This must be an algorithm resource that you created or subscribe to on AWS Marketplace. If you specify a value for this parameter, you can't specify a value for TrainingImage .

  • TrainingInputMode (string) -- [REQUIRED]

    The input mode that the algorithm supports. For the input modes that Amazon SageMaker algorithms support, see Algorithms. If an algorithm supports the File input mode, Amazon SageMaker downloads the training data from S3 to the provisioned ML storage Volume, and mounts the directory to docker volume for training container. If an algorithm supports the Pipe input mode, Amazon SageMaker streams data directly from S3 to the container.

    In File mode, make sure you provision ML storage volume with sufficient capacity to accommodate the data download from S3. In addition to the training data, the ML storage volume also stores the output model. The algorithm container use ML storage volume to also store intermediate information, if any.

    For distributed algorithms using File mode, training data is distributed uniformly, and your training duration is predictable if the input data objects size is approximately same. Amazon SageMaker does not split the files any further for model training. If the object sizes are skewed, training won't be optimal as the data distribution is also skewed where one host in a training cluster is overloaded, thus becoming bottleneck in training.

  • MetricDefinitions (list) --

    A list of metric definition objects. Each object specifies the metric name and regular expressions used to parse algorithm logs. Amazon SageMaker publishes each metric to Amazon CloudWatch.

    • (dict) --

      Specifies a metric that the training algorithm writes to stderr or stdout . Amazon SageMakerhyperparameter tuning captures all defined metrics. You specify one metric that a hyperparameter tuning job uses as its objective metric to choose the best training job.

      • Name (string) -- [REQUIRED]

        The name of the metric.

      • Regex (string) -- [REQUIRED]

        A regular expression that searches the output of a training job and gets the value of the metric. For more information about using regular expressions to define metrics, see Defining Objective Metrics.

type RoleArn

string

param RoleArn

[REQUIRED]

The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker can assume to perform tasks on your behalf.

During model training, Amazon SageMaker needs your permission to read input data from an S3 bucket, download a Docker image that contains training code, write model artifacts to an S3 bucket, write logs to Amazon CloudWatch Logs, and publish metrics to Amazon CloudWatch. You grant permissions for all of these tasks to an IAM role. For more information, see Amazon SageMaker Roles.

Note

To be able to pass this role to Amazon SageMaker, the caller of this API must have the iam:PassRole permission.

type InputDataConfig

list

param InputDataConfig

An array of Channel objects. Each channel is a named input source. InputDataConfig describes the input data and its location.

Algorithms can accept input data from one or more channels. For example, an algorithm might have two channels of input data, training_data and validation_data . The configuration for each channel provides the S3 location where the input data is stored. It also provides information about the stored data: the MIME type, compression method, and whether the data is wrapped in RecordIO format.

Depending on the input mode that the algorithm supports, Amazon SageMaker either copies input data files from an S3 bucket to a local directory in the Docker container, or makes it available as input streams.

  • (dict) --

    A channel is a named input source that training algorithms can consume.

    • ChannelName (string) -- [REQUIRED]

      The name of the channel.

    • DataSource (dict) -- [REQUIRED]

      The location of the channel data.

      • S3DataSource (dict) -- [REQUIRED]

        The S3 location of the data source that is associated with a channel.

        • S3DataType (string) -- [REQUIRED]

          If you choose S3Prefix , S3Uri identifies a key name prefix. Amazon SageMaker uses all objects that match the specified key name prefix for model training.

          If you choose ManifestFile , S3Uri identifies an object that is a manifest file containing a list of object keys that you want Amazon SageMaker to use for model training.

          If you choose AugmentedManifestFile , S3Uri identifies an object that is an augmented manifest file in JSON lines format. This file contains the data you want to use for model training. AugmentedManifestFile can only be used if the Channel's input mode is Pipe .

        • S3Uri (string) -- [REQUIRED]

          Depending on the value specified for the S3DataType , identifies either a key name prefix or a manifest. For example:

          • A key name prefix might look like this: s3://bucketname/exampleprefix .

          • A manifest might look like this: s3://bucketname/example.manifest The manifest is an S3 object which is a JSON file with the following format: [ {"prefix": "s3://customer_bucket/some/prefix/"}, "relative/path/to/custdata-1", "relative/path/custdata-2", ... ] The preceding JSON matches the following s3Uris : s3://customer_bucket/some/prefix/relative/path/to/custdata-1 s3://customer_bucket/some/prefix/relative/path/custdata-2 ... The complete set of s3uris in this manifest is the input data for the channel for this datasource. The object that each s3uris points to must be readable by the IAM role that Amazon SageMaker uses to perform tasks on your behalf.

        • S3DataDistributionType (string) --

          If you want Amazon SageMaker to replicate the entire dataset on each ML compute instance that is launched for model training, specify FullyReplicated .

          If you want Amazon SageMaker to replicate a subset of data on each ML compute instance that is launched for model training, specify ShardedByS3Key . If there are n ML compute instances launched for a training job, each instance gets approximately 1/n of the number of S3 objects. In this case, model training on each machine uses only the subset of training data.

          Don't choose more ML compute instances for training than available S3 objects. If you do, some nodes won't get any data and you will pay for nodes that aren't getting any training data. This applies in both File and Pipe modes. Keep this in mind when developing algorithms.

          In distributed training, where you use multiple ML compute EC2 instances, you might choose ShardedByS3Key . If the algorithm requires copying training data to the ML storage volume (when TrainingInputMode is set to File ), this copies 1/n of the number of objects.

        • AttributeNames (list) --

          A list of one or more attribute names to use that are found in a specified augmented manifest file.

          • (string) --

    • ContentType (string) --

      The MIME type of the data.

    • CompressionType (string) --

      If training data is compressed, the compression type. The default value is None . CompressionType is used only in Pipe input mode. In File mode, leave this field unset or set it to None.

    • RecordWrapperType (string) --

      Specify RecordIO as the value when input data is in raw format but the training algorithm requires the RecordIO format. In this case, Amazon SageMaker wraps each individual S3 object in a RecordIO record. If the input data is already in RecordIO format, you don't need to set this attribute. For more information, see Create a Dataset Using RecordIO.

      In File mode, leave this field unset or set it to None.

    • InputMode (string) --

      (Optional) The input mode to use for the data channel in a training job. If you don't set a value for InputMode , Amazon SageMaker uses the value set for TrainingInputMode . Use this parameter to override the TrainingInputMode setting in a AlgorithmSpecification request when you have a channel that needs a different input mode from the training job's general setting. To download the data from Amazon Simple Storage Service (Amazon S3) to the provisioned ML storage volume, and mount the directory to a Docker volume, use File input mode. To stream data directly from Amazon S3 to the container, choose Pipe input mode.

      To use a model for incremental training, choose File input model.

    • ShuffleConfig (dict) --

      A configuration for a shuffle option for input data in a channel. If you use S3Prefix for S3DataType , this shuffles the results of the S3 key prefix matches. If you use ManifestFile , the order of the S3 object references in the ManifestFile is shuffled. If you use AugmentedManifestFile , the order of the JSON lines in the AugmentedManifestFile is shuffled. The shuffling order is determined using the Seed value.

      For Pipe input mode, shuffling is done at the start of every epoch. With large datasets this ensures that the order of the training data is different for each epoch, it helps reduce bias and possible overfitting. In a multi-node training job when ShuffleConfig is combined with S3DataDistributionType of ShardedByS3Key , the data is shuffled across nodes so that the content sent to a particular node on the first epoch might be sent to a different node on the second epoch.

      • Seed (integer) -- [REQUIRED]

        Determines the shuffling order in ShuffleConfig value.

type OutputDataConfig

dict

param OutputDataConfig

[REQUIRED]

Specifies the path to the S3 bucket where you want to store model artifacts. Amazon SageMaker creates subfolders for the artifacts.

  • KmsKeyId (string) --

    The AWS Key Management Service (AWS KMS) key that Amazon SageMaker uses to encrypt the model artifacts at rest using Amazon S3 server-side encryption. The KmsKeyId can be any of the following formats:

    • // KMS Key ID "1234abcd-12ab-34cd-56ef-1234567890ab"

    • // Amazon Resource Name (ARN) of a KMS Key "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"

    • // KMS Key Alias "alias/ExampleAlias"

    • // Amazon Resource Name (ARN) of a KMS Key Alias "arn:aws:kms:us-west-2:111122223333:alias/ExampleAlias"

    If you don't provide a KMS key ID, Amazon SageMaker uses the default KMS key for Amazon S3 for your role's account. For more information, see KMS-Managed Encryption Keys in the Amazon Simple Storage Service Developer Guide.

    The KMS key policy must grant permission to the IAM role that you specify in your CreateTramsformJob request. For more information, see Using Key Policies in AWS KMS in the AWS Key Management Service Developer Guide .

  • S3OutputPath (string) -- [REQUIRED]

    Identifies the S3 path where you want Amazon SageMaker to store the model artifacts. For example, s3://bucket-name/key-name-prefix .

type ResourceConfig

dict

param ResourceConfig

[REQUIRED]

The resources, including the ML compute instances and ML storage volumes, to use for model training.

ML storage volumes store model artifacts and incremental states. Training algorithms might also use ML storage volumes for scratch space. If you want Amazon SageMaker to use the ML storage volume to store the training data, choose File as the TrainingInputMode in the algorithm specification. For distributed training algorithms, specify an instance count greater than 1.

  • InstanceType (string) -- [REQUIRED]

    The ML compute instance type.

  • InstanceCount (integer) -- [REQUIRED]

    The number of ML compute instances to use. For distributed training, provide a value greater than 1.

  • VolumeSizeInGB (integer) -- [REQUIRED]

    The size of the ML storage volume that you want to provision.

    ML storage volumes store model artifacts and incremental states. Training algorithms might also use the ML storage volume for scratch space. If you want to store the training data in the ML storage volume, choose File as the TrainingInputMode in the algorithm specification.

    You must specify sufficient ML storage for your scenario.

    Note

    Amazon SageMaker supports only the General Purpose SSD (gp2) ML storage volume type.

  • VolumeKmsKeyId (string) --

    The AWS Key Management Service (AWS KMS) key that Amazon SageMaker uses to encrypt data on the storage volume attached to the ML compute instance(s) that run the training job. The VolumeKmsKeyId can be any of the following formats:

    • // KMS Key ID "1234abcd-12ab-34cd-56ef-1234567890ab"

    • // Amazon Resource Name (ARN) of a KMS Key "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"

type VpcConfig

dict

param VpcConfig

A VpcConfig object that specifies the VPC that you want your training job to connect to. Control access to and from your training container by configuring the VPC. For more information, see Protect Training Jobs by Using an Amazon Virtual Private Cloud.

  • SecurityGroupIds (list) -- [REQUIRED]

    The VPC security group IDs, in the form sg-xxxxxxxx. Specify the security groups for the VPC that is specified in the Subnets field.

    • (string) --

  • Subnets (list) -- [REQUIRED]

    The ID of the subnets in the VPC to which you want to connect your training job or model.

    • (string) --

type StoppingCondition

dict

param StoppingCondition

[REQUIRED]

Sets a duration for training. Use this parameter to cap model training costs. To stop a job, Amazon SageMaker sends the algorithm the SIGTERM signal, which delays job termination for 120 seconds. Algorithms might use this 120-second window to save the model artifacts.

When Amazon SageMaker terminates a job because the stopping condition has been met, training algorithms provided by Amazon SageMaker save the intermediate results of the job. This intermediate data is a valid model artifact. You can use it to create a model using the CreateModel API.

  • MaxRuntimeInSeconds (integer) --

    The maximum length of time, in seconds, that the training job can run. If model training does not complete during this time, Amazon SageMaker ends the job. If value is not specified, default value is 1 day. Maximum value is 28 days.

type Tags

list

param Tags

An array of key-value pairs. For more information, see Using Cost Allocation Tags in the AWS Billing and Cost Management User Guide .

  • (dict) --

    Describes a tag.

    • Key (string) -- [REQUIRED]

      The tag key.

    • Value (string) -- [REQUIRED]

      The tag value.

type EnableNetworkIsolation

boolean

param EnableNetworkIsolation

Isolates the training container. No inbound or outbound network calls can be made, except for calls between peers within a training cluster for distributed training. If you enable network isolation for training jobs that are configured to use a VPC, Amazon SageMaker downloads and uploads customer data and model artifacts through the specified VPC, but the training container does not have network access.

Note

The Semantic Segmentation built-in algorithm does not support network isolation.

type EnableInterContainerTrafficEncryption

boolean

param EnableInterContainerTrafficEncryption

To encrypt all communications between ML compute instances in distributed training, choose True ,. Encryption provides greater security for distributed training, but training can take longer because of additional communications between ML compute instances.

rtype

dict

returns

Response Syntax

{
    'TrainingJobArn': 'string'
}

Response Structure

  • (dict) --

    • TrainingJobArn (string) --

      The Amazon Resource Name (ARN) of the training job.

DescribeHyperParameterTuningJob (updated) Link ¶
Changes (response)
{'TrainingJobDefinition': {'EnableInterContainerTrafficEncryption': 'boolean'}}

Gets a description of a hyperparameter tuning job.

See also: AWS API Documentation

Request Syntax

client.describe_hyper_parameter_tuning_job(
    HyperParameterTuningJobName='string'
)
type HyperParameterTuningJobName

string

param HyperParameterTuningJobName

[REQUIRED]

The name of the tuning job to describe.

rtype

dict

returns

Response Syntax

{
    'HyperParameterTuningJobName': 'string',
    'HyperParameterTuningJobArn': 'string',
    'HyperParameterTuningJobConfig': {
        'Strategy': 'Bayesian',
        'HyperParameterTuningJobObjective': {
            'Type': 'Maximize'|'Minimize',
            'MetricName': 'string'
        },
        'ResourceLimits': {
            'MaxNumberOfTrainingJobs': 123,
            'MaxParallelTrainingJobs': 123
        },
        'ParameterRanges': {
            'IntegerParameterRanges': [
                {
                    'Name': 'string',
                    'MinValue': 'string',
                    'MaxValue': 'string'
                },
            ],
            'ContinuousParameterRanges': [
                {
                    'Name': 'string',
                    'MinValue': 'string',
                    'MaxValue': 'string'
                },
            ],
            'CategoricalParameterRanges': [
                {
                    'Name': 'string',
                    'Values': [
                        'string',
                    ]
                },
            ]
        },
        'TrainingJobEarlyStoppingType': 'Off'|'Auto'
    },
    'TrainingJobDefinition': {
        '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': 123
                }
            },
        ],
        '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': 123,
            'VolumeSizeInGB': 123,
            'VolumeKmsKeyId': 'string'
        },
        'StoppingCondition': {
            'MaxRuntimeInSeconds': 123
        },
        'EnableNetworkIsolation': True|False,
        'EnableInterContainerTrafficEncryption': True|False
    },
    'HyperParameterTuningJobStatus': 'Completed'|'InProgress'|'Failed'|'Stopped'|'Stopping',
    'CreationTime': datetime(2015, 1, 1),
    'HyperParameterTuningEndTime': datetime(2015, 1, 1),
    'LastModifiedTime': datetime(2015, 1, 1),
    'TrainingJobStatusCounters': {
        'Completed': 123,
        'InProgress': 123,
        'RetryableError': 123,
        'NonRetryableError': 123,
        'Stopped': 123
    },
    'ObjectiveStatusCounters': {
        'Succeeded': 123,
        'Pending': 123,
        'Failed': 123
    },
    'BestTrainingJob': {
        'TrainingJobName': 'string',
        'TrainingJobArn': 'string',
        'TuningJobName': 'string',
        'CreationTime': datetime(2015, 1, 1),
        'TrainingStartTime': datetime(2015, 1, 1),
        'TrainingEndTime': datetime(2015, 1, 1),
        'TrainingJobStatus': 'InProgress'|'Completed'|'Failed'|'Stopping'|'Stopped',
        'TunedHyperParameters': {
            'string': 'string'
        },
        'FailureReason': 'string',
        'FinalHyperParameterTuningJobObjectiveMetric': {
            'Type': 'Maximize'|'Minimize',
            'MetricName': 'string',
            'Value': ...
        },
        'ObjectiveStatus': 'Succeeded'|'Pending'|'Failed'
    },
    'OverallBestTrainingJob': {
        'TrainingJobName': 'string',
        'TrainingJobArn': 'string',
        'TuningJobName': 'string',
        'CreationTime': datetime(2015, 1, 1),
        'TrainingStartTime': datetime(2015, 1, 1),
        'TrainingEndTime': datetime(2015, 1, 1),
        'TrainingJobStatus': 'InProgress'|'Completed'|'Failed'|'Stopping'|'Stopped',
        'TunedHyperParameters': {
            'string': 'string'
        },
        'FailureReason': 'string',
        'FinalHyperParameterTuningJobObjectiveMetric': {
            'Type': 'Maximize'|'Minimize',
            'MetricName': 'string',
            'Value': ...
        },
        'ObjectiveStatus': 'Succeeded'|'Pending'|'Failed'
    },
    'WarmStartConfig': {
        'ParentHyperParameterTuningJobs': [
            {
                'HyperParameterTuningJobName': 'string'
            },
        ],
        'WarmStartType': 'IdenticalDataAndAlgorithm'|'TransferLearning'
    },
    'FailureReason': 'string'
}

Response Structure

  • (dict) --

    • HyperParameterTuningJobName (string) --

      The name of the tuning job.

    • HyperParameterTuningJobArn (string) --

      The Amazon Resource Name (ARN) of the tuning job.

    • HyperParameterTuningJobConfig (dict) --

      The HyperParameterTuningJobConfig object that specifies the configuration of the tuning job.

      • Strategy (string) --

        Specifies the search strategy for hyperparameters. Currently, the only valid value is Bayesian .

      • HyperParameterTuningJobObjective (dict) --

        The HyperParameterTuningJobObjective object that specifies the objective metric for this tuning job.

        • Type (string) --

          Whether to minimize or maximize the objective metric.

        • MetricName (string) --

          The name of the metric to use for the objective metric.

      • ResourceLimits (dict) --

        The ResourceLimits object that specifies the maximum number of training jobs and parallel training jobs for this tuning job.

        • MaxNumberOfTrainingJobs (integer) --

          The maximum number of training jobs that a hyperparameter tuning job can launch.

        • MaxParallelTrainingJobs (integer) --

          The maximum number of concurrent training jobs that a hyperparameter tuning job can launch.

      • ParameterRanges (dict) --

        The ParameterRanges object that specifies the ranges of hyperparameters that this tuning job searches.

        • IntegerParameterRanges (list) --

          The array of IntegerParameterRange objects that specify ranges of integer hyperparameters that a hyperparameter tuning job searches.

          • (dict) --

            For a hyperparameter of the integer type, specifies the range that a hyperparameter tuning job searches.

            • Name (string) --

              The name of the hyperparameter to search.

            • MinValue (string) --

              The minimum value of the hyperparameter to search.

            • MaxValue (string) --

              The maximum value of the hyperparameter to search.

        • ContinuousParameterRanges (list) --

          The array of ContinuousParameterRange objects that specify ranges of continuous hyperparameters that a hyperparameter tuning job searches.

          • (dict) --

            A list of continuous hyperparameters to tune.

            • Name (string) --

              The name of the continuous hyperparameter to tune.

            • MinValue (string) --

              The minimum value for the hyperparameter. The tuning job uses floating-point values between this value and MaxValue for tuning.

            • MaxValue (string) --

              The maximum value for the hyperparameter. The tuning job uses floating-point values between MinValue value and this value for tuning.

        • CategoricalParameterRanges (list) --

          The array of CategoricalParameterRange objects that specify ranges of categorical hyperparameters that a hyperparameter tuning job searches.

          • (dict) --

            A list of categorical hyperparameters to tune.

            • Name (string) --

              The name of the categorical hyperparameter to tune.

            • Values (list) --

              A list of the categories for the hyperparameter.

              • (string) --

      • TrainingJobEarlyStoppingType (string) --

        Specifies whether to use early stopping for training jobs launched by the hyperparameter tuning job. This can be one of the following values (the default value is OFF ):

        OFF

        Training jobs launched by the hyperparameter tuning job do not use early stopping.

        AUTO

        Amazon SageMaker stops training jobs launched by the hyperparameter tuning job when they are unlikely to perform better than previously completed training jobs. For more information, see Stop Training Jobs Early.

    • TrainingJobDefinition (dict) --

      The HyperParameterTrainingJobDefinition object that specifies the definition of the training jobs that this tuning job launches.

      • StaticHyperParameters (dict) --

        Specifies the values of hyperparameters that do not change for the tuning job.

        • (string) --

          • (string) --

      • AlgorithmSpecification (dict) --

        The HyperParameterAlgorithmSpecification object that specifies the resource algorithm to use for the training jobs that the tuning job launches.

        • TrainingImage (string) --

          The registry path of the Docker image that contains the training algorithm. For information about Docker registry paths for built-in algorithms, see Algorithms Provided by Amazon SageMaker: Common Parameters.

        • TrainingInputMode (string) --

          The input mode that the algorithm supports: File or Pipe. In File input mode, Amazon SageMaker downloads the training data from Amazon S3 to the storage volume that is attached to the training instance and mounts the directory to the Docker volume for the training container. In Pipe input mode, Amazon SageMaker streams data directly from Amazon S3 to the container.

          If you specify File mode, make sure that you provision the storage volume that is attached to the training instance with enough capacity to accommodate the training data downloaded from Amazon S3, the model artifacts, and intermediate information.

          For more information about input modes, see Algorithms.

        • AlgorithmName (string) --

          The name of the resource algorithm to use for the hyperparameter tuning job. If you specify a value for this parameter, do not specify a value for TrainingImage .

        • MetricDefinitions (list) --

          An array of MetricDefinition objects that specify the metrics that the algorithm emits.

          • (dict) --

            Specifies a metric that the training algorithm writes to stderr or stdout . Amazon SageMakerhyperparameter tuning captures all defined metrics. You specify one metric that a hyperparameter tuning job uses as its objective metric to choose the best training job.

            • Name (string) --

              The name of the metric.

            • Regex (string) --

              A regular expression that searches the output of a training job and gets the value of the metric. For more information about using regular expressions to define metrics, see Defining Objective Metrics.

      • RoleArn (string) --

        The Amazon Resource Name (ARN) of the IAM role associated with the training jobs that the tuning job launches.

      • InputDataConfig (list) --

        An array of Channel objects that specify the input for the training jobs that the tuning job launches.

        • (dict) --

          A channel is a named input source that training algorithms can consume.

          • ChannelName (string) --

            The name of the channel.

          • DataSource (dict) --

            The location of the channel data.

            • S3DataSource (dict) --

              The S3 location of the data source that is associated with a channel.

              • S3DataType (string) --

                If you choose S3Prefix , S3Uri identifies a key name prefix. Amazon SageMaker uses all objects that match the specified key name prefix for model training.

                If you choose ManifestFile , S3Uri identifies an object that is a manifest file containing a list of object keys that you want Amazon SageMaker to use for model training.

                If you choose AugmentedManifestFile , S3Uri identifies an object that is an augmented manifest file in JSON lines format. This file contains the data you want to use for model training. AugmentedManifestFile can only be used if the Channel's input mode is Pipe .

              • S3Uri (string) --

                Depending on the value specified for the S3DataType , identifies either a key name prefix or a manifest. For example:

                • A key name prefix might look like this: s3://bucketname/exampleprefix .

                • A manifest might look like this: s3://bucketname/example.manifest The manifest is an S3 object which is a JSON file with the following format: [ {"prefix": "s3://customer_bucket/some/prefix/"}, "relative/path/to/custdata-1", "relative/path/custdata-2", ... ] The preceding JSON matches the following s3Uris : s3://customer_bucket/some/prefix/relative/path/to/custdata-1 s3://customer_bucket/some/prefix/relative/path/custdata-2 ... The complete set of s3uris in this manifest is the input data for the channel for this datasource. The object that each s3uris points to must be readable by the IAM role that Amazon SageMaker uses to perform tasks on your behalf.

              • S3DataDistributionType (string) --

                If you want Amazon SageMaker to replicate the entire dataset on each ML compute instance that is launched for model training, specify FullyReplicated .

                If you want Amazon SageMaker to replicate a subset of data on each ML compute instance that is launched for model training, specify ShardedByS3Key . If there are n ML compute instances launched for a training job, each instance gets approximately 1/n of the number of S3 objects. In this case, model training on each machine uses only the subset of training data.

                Don't choose more ML compute instances for training than available S3 objects. If you do, some nodes won't get any data and you will pay for nodes that aren't getting any training data. This applies in both File and Pipe modes. Keep this in mind when developing algorithms.

                In distributed training, where you use multiple ML compute EC2 instances, you might choose ShardedByS3Key . If the algorithm requires copying training data to the ML storage volume (when TrainingInputMode is set to File ), this copies 1/n of the number of objects.

              • AttributeNames (list) --

                A list of one or more attribute names to use that are found in a specified augmented manifest file.

                • (string) --

          • ContentType (string) --

            The MIME type of the data.

          • CompressionType (string) --

            If training data is compressed, the compression type. The default value is None . CompressionType is used only in Pipe input mode. In File mode, leave this field unset or set it to None.

          • RecordWrapperType (string) --

            Specify RecordIO as the value when input data is in raw format but the training algorithm requires the RecordIO format. In this case, Amazon SageMaker wraps each individual S3 object in a RecordIO record. If the input data is already in RecordIO format, you don't need to set this attribute. For more information, see Create a Dataset Using RecordIO.

            In File mode, leave this field unset or set it to None.

          • InputMode (string) --

            (Optional) The input mode to use for the data channel in a training job. If you don't set a value for InputMode , Amazon SageMaker uses the value set for TrainingInputMode . Use this parameter to override the TrainingInputMode setting in a AlgorithmSpecification request when you have a channel that needs a different input mode from the training job's general setting. To download the data from Amazon Simple Storage Service (Amazon S3) to the provisioned ML storage volume, and mount the directory to a Docker volume, use File input mode. To stream data directly from Amazon S3 to the container, choose Pipe input mode.

            To use a model for incremental training, choose File input model.

          • ShuffleConfig (dict) --

            A configuration for a shuffle option for input data in a channel. If you use S3Prefix for S3DataType , this shuffles the results of the S3 key prefix matches. If you use ManifestFile , the order of the S3 object references in the ManifestFile is shuffled. If you use AugmentedManifestFile , the order of the JSON lines in the AugmentedManifestFile is shuffled. The shuffling order is determined using the Seed value.

            For Pipe input mode, shuffling is done at the start of every epoch. With large datasets this ensures that the order of the training data is different for each epoch, it helps reduce bias and possible overfitting. In a multi-node training job when ShuffleConfig is combined with S3DataDistributionType of ShardedByS3Key , the data is shuffled across nodes so that the content sent to a particular node on the first epoch might be sent to a different node on the second epoch.

            • Seed (integer) --

              Determines the shuffling order in ShuffleConfig value.

      • VpcConfig (dict) --

        The VpcConfig object that specifies the VPC that you want the training jobs that this hyperparameter tuning job launches to connect to. Control access to and from your training container by configuring the VPC. For more information, see Protect Training Jobs by Using an Amazon Virtual Private Cloud.

        • SecurityGroupIds (list) --

          The VPC security group IDs, in the form sg-xxxxxxxx. Specify the security groups for the VPC that is specified in the Subnets field.

          • (string) --

        • Subnets (list) --

          The ID of the subnets in the VPC to which you want to connect your training job or model.

          • (string) --

      • OutputDataConfig (dict) --

        Specifies the path to the Amazon S3 bucket where you store model artifacts from the training jobs that the tuning job launches.

        • KmsKeyId (string) --

          The AWS Key Management Service (AWS KMS) key that Amazon SageMaker uses to encrypt the model artifacts at rest using Amazon S3 server-side encryption. The KmsKeyId can be any of the following formats:

          • // KMS Key ID "1234abcd-12ab-34cd-56ef-1234567890ab"

          • // Amazon Resource Name (ARN) of a KMS Key "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"

          • // KMS Key Alias "alias/ExampleAlias"

          • // Amazon Resource Name (ARN) of a KMS Key Alias "arn:aws:kms:us-west-2:111122223333:alias/ExampleAlias"

          If you don't provide a KMS key ID, Amazon SageMaker uses the default KMS key for Amazon S3 for your role's account. For more information, see KMS-Managed Encryption Keys in the Amazon Simple Storage Service Developer Guide.

          The KMS key policy must grant permission to the IAM role that you specify in your CreateTramsformJob request. For more information, see Using Key Policies in AWS KMS in the AWS Key Management Service Developer Guide .

        • S3OutputPath (string) --

          Identifies the S3 path where you want Amazon SageMaker to store the model artifacts. For example, s3://bucket-name/key-name-prefix .

      • ResourceConfig (dict) --

        The resources, including the compute instances and storage volumes, to use for the training jobs that the tuning job launches.

        Storage volumes store model artifacts and incremental states. Training algorithms might also use storage volumes for scratch space. If you want Amazon SageMaker to use the storage volume to store the training data, choose File as the TrainingInputMode in the algorithm specification. For distributed training algorithms, specify an instance count greater than 1.

        • InstanceType (string) --

          The ML compute instance type.

        • InstanceCount (integer) --

          The number of ML compute instances to use. For distributed training, provide a value greater than 1.

        • VolumeSizeInGB (integer) --

          The size of the ML storage volume that you want to provision.

          ML storage volumes store model artifacts and incremental states. Training algorithms might also use the ML storage volume for scratch space. If you want to store the training data in the ML storage volume, choose File as the TrainingInputMode in the algorithm specification.

          You must specify sufficient ML storage for your scenario.

          Note

          Amazon SageMaker supports only the General Purpose SSD (gp2) ML storage volume type.

        • VolumeKmsKeyId (string) --

          The AWS Key Management Service (AWS KMS) key that Amazon SageMaker uses to encrypt data on the storage volume attached to the ML compute instance(s) that run the training job. The VolumeKmsKeyId can be any of the following formats:

          • // KMS Key ID "1234abcd-12ab-34cd-56ef-1234567890ab"

          • // Amazon Resource Name (ARN) of a KMS Key "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"

      • StoppingCondition (dict) --

        Sets a maximum duration for the training jobs that the tuning job launches. Use this parameter to limit model training costs.

        To stop a job, Amazon SageMaker sends the algorithm the SIGTERM signal. This delays job termination for 120 seconds. Algorithms might use this 120-second window to save the model artifacts.

        When Amazon SageMaker terminates a job because the stopping condition has been met, training algorithms provided by Amazon SageMaker save the intermediate results of the job.

        • MaxRuntimeInSeconds (integer) --

          The maximum length of time, in seconds, that the training job can run. If model training does not complete during this time, Amazon SageMaker ends the job. If value is not specified, default value is 1 day. Maximum value is 28 days.

      • EnableNetworkIsolation (boolean) --

        Isolates the training container. No inbound or outbound network calls can be made, except for calls between peers within a training cluster for distributed training. If network isolation is used for training jobs that are configured to use a VPC, Amazon SageMaker downloads and uploads customer data and model artifacts through the specified VPC, but the training container does not have network access.

        Note

        The Semantic Segmentation built-in algorithm does not support network isolation.

      • EnableInterContainerTrafficEncryption (boolean) --

        To encrypt all communications between ML compute instances in distributed training, specify True . Encryption provides greater security for distributed training, but training take longer because of the additional communications between ML compute instances.

    • HyperParameterTuningJobStatus (string) --

      The status of the tuning job: InProgress, Completed, Failed, Stopping, or Stopped.

    • CreationTime (datetime) --

      The date and time that the tuning job started.

    • HyperParameterTuningEndTime (datetime) --

      The date and time that the tuning job ended.

    • LastModifiedTime (datetime) --

      The date and time that the status of the tuning job was modified.

    • TrainingJobStatusCounters (dict) --

      The TrainingJobStatusCounters object that specifies the number of training jobs, categorized by status, that this tuning job launched.

      • Completed (integer) --

        The number of completed training jobs launched by the hyperparameter tuning job.

      • InProgress (integer) --

        The number of in-progress training jobs launched by a hyperparameter tuning job.

      • RetryableError (integer) --

        The number of training jobs that failed, but can be retried. A failed training job can be retried only if it failed because an internal service error occurred.

      • NonRetryableError (integer) --

        The number of training jobs that failed and can't be retried. A failed training job can't be retried if it failed because a client error occurred.

      • Stopped (integer) --

        The number of training jobs launched by a hyperparameter tuning job that were manually stopped.

    • ObjectiveStatusCounters (dict) --

      The ObjectiveStatusCounters object that specifies the number of training jobs, categorized by the status of their final objective metric, that this tuning job launched.

      • Succeeded (integer) --

        The number of training jobs whose final objective metric was evaluated by the hyperparameter tuning job and used in the hyperparameter tuning process.

      • Pending (integer) --

        The number of training jobs that are in progress and pending evaluation of their final objective metric.

      • Failed (integer) --

        The number of training jobs whose final objective metric was not evaluated and used in the hyperparameter tuning process. This typically occurs when the training job failed or did not emit an objective metric.

    • BestTrainingJob (dict) --

      A TrainingJobSummary object that describes the training job that completed with the best current HyperParameterTuningJobObjective.

      • TrainingJobName (string) --

        The name of the training job.

      • TrainingJobArn (string) --

        The Amazon Resource Name (ARN) of the training job.

      • TuningJobName (string) --

        The HyperParameter tuning job that launched the training job.

      • CreationTime (datetime) --

        The date and time that the training job was created.

      • TrainingStartTime (datetime) --

        The date and time that the training job started.

      • TrainingEndTime (datetime) --

        Specifies the time when the training job ends on training instances. You are billed for the time interval between the value of TrainingStartTime and this time. For successful jobs and stopped jobs, this is the time after model artifacts are uploaded. For failed jobs, this is the time when Amazon SageMaker detects a job failure.

      • TrainingJobStatus (string) --

        The status of the training job.

      • TunedHyperParameters (dict) --

        A list of the hyperparameters for which you specified ranges to search.

        • (string) --

          • (string) --

      • FailureReason (string) --

        The reason that the training job failed.

      • FinalHyperParameterTuningJobObjectiveMetric (dict) --

        The FinalHyperParameterTuningJobObjectiveMetric object that specifies the value of the objective metric of the tuning job that launched this training job.

        • Type (string) --

          Whether to minimize or maximize the objective metric. Valid values are Minimize and Maximize.

        • MetricName (string) --

          The name of the objective metric.

        • Value (float) --

          The value of the objective metric.

      • ObjectiveStatus (string) --

        The status of the objective metric for the training job:

        • Succeeded: The final objective metric for the training job was evaluated by the hyperparameter tuning job and used in the hyperparameter tuning process.

        • Pending: The training job is in progress and evaluation of its final objective metric is pending.

        • Failed: The final objective metric for the training job was not evaluated, and was not used in the hyperparameter tuning process. This typically occurs when the training job failed or did not emit an objective metric.

    • OverallBestTrainingJob (dict) --

      If the hyperparameter tuning job is an warm start tuning job with a WarmStartType of IDENTICAL_DATA_AND_ALGORITHM , this is the TrainingJobSummary for the training job with the best objective metric value of all training jobs launched by this tuning job and all parent jobs specified for the warm start tuning job.

      • TrainingJobName (string) --

        The name of the training job.

      • TrainingJobArn (string) --

        The Amazon Resource Name (ARN) of the training job.

      • TuningJobName (string) --

        The HyperParameter tuning job that launched the training job.

      • CreationTime (datetime) --

        The date and time that the training job was created.

      • TrainingStartTime (datetime) --

        The date and time that the training job started.

      • TrainingEndTime (datetime) --

        Specifies the time when the training job ends on training instances. You are billed for the time interval between the value of TrainingStartTime and this time. For successful jobs and stopped jobs, this is the time after model artifacts are uploaded. For failed jobs, this is the time when Amazon SageMaker detects a job failure.

      • TrainingJobStatus (string) --

        The status of the training job.

      • TunedHyperParameters (dict) --

        A list of the hyperparameters for which you specified ranges to search.

        • (string) --

          • (string) --

      • FailureReason (string) --

        The reason that the training job failed.

      • FinalHyperParameterTuningJobObjectiveMetric (dict) --

        The FinalHyperParameterTuningJobObjectiveMetric object that specifies the value of the objective metric of the tuning job that launched this training job.

        • Type (string) --

          Whether to minimize or maximize the objective metric. Valid values are Minimize and Maximize.

        • MetricName (string) --

          The name of the objective metric.

        • Value (float) --

          The value of the objective metric.

      • ObjectiveStatus (string) --

        The status of the objective metric for the training job:

        • Succeeded: The final objective metric for the training job was evaluated by the hyperparameter tuning job and used in the hyperparameter tuning process.

        • Pending: The training job is in progress and evaluation of its final objective metric is pending.

        • Failed: The final objective metric for the training job was not evaluated, and was not used in the hyperparameter tuning process. This typically occurs when the training job failed or did not emit an objective metric.

    • WarmStartConfig (dict) --

      The configuration for starting the hyperparameter parameter 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.

      • ParentHyperParameterTuningJobs (list) --

        An array of hyperparameter tuning jobs that are used as the starting point for the new hyperparameter tuning job. For more information about warm starting a hyperparameter tuning job, see Using a Previous Hyperparameter Tuning Job as a Starting Point.

        Hyperparameter tuning jobs created before October 1, 2018 cannot be used as parent jobs for warm start tuning jobs.

        • (dict) --

          A previously completed or stopped hyperparameter tuning job to be used as a starting point for a new hyperparameter tuning job.

          • HyperParameterTuningJobName (string) --

            The name of the hyperparameter tuning job to be used as a starting point for a new hyperparameter tuning job.

      • WarmStartType (string) --

        Specifies one of the following:

        IDENTICAL_DATA_AND_ALGORITHM

        The new hyperparameter tuning job uses the same input data and training image as the parent tuning jobs. You can change the hyperparameter ranges to search and the maximum number of training jobs that the hyperparameter tuning job launches. You cannot use a new version of the training algorithm, unless the changes in the new version do not affect the algorithm itself. For example, changes that improve logging or adding support for a different data format are allowed. You can also change hyperparameters from tunable to static, and from static to tunable, but the total number of static plus tunable hyperparameters must remain the same as it is in all parent jobs. The objective metric for the new tuning job must be the same as for all parent jobs.

        TRANSFER_LEARNING

        The new hyperparameter tuning job can include input data, hyperparameter ranges, maximum number of concurrent training jobs, and maximum number of training jobs that are different than those of its parent hyperparameter tuning jobs. The training image can also be a different version from the version used in the parent hyperparameter tuning job. You can also change hyperparameters from tunable to static, and from static to tunable, but the total number of static plus tunable hyperparameters must remain the same as it is in all parent jobs. The objective metric for the new tuning job must be the same as for all parent jobs.

    • FailureReason (string) --

      If the tuning job failed, the reason it failed.

DescribeTrainingJob (updated) Link ¶
Changes (response)
{'EnableInterContainerTrafficEncryption': 'boolean'}

Returns information about a training job.

See also: AWS API Documentation

Request Syntax

client.describe_training_job(
    TrainingJobName='string'
)
type TrainingJobName

string

param TrainingJobName

[REQUIRED]

The name of the training job.

rtype

dict

returns

Response Syntax

{
    'TrainingJobName': 'string',
    'TrainingJobArn': 'string',
    'TuningJobArn': 'string',
    'LabelingJobArn': 'string',
    'ModelArtifacts': {
        'S3ModelArtifacts': 'string'
    },
    'TrainingJobStatus': 'InProgress'|'Completed'|'Failed'|'Stopping'|'Stopped',
    'SecondaryStatus': 'Starting'|'LaunchingMLInstances'|'PreparingTrainingStack'|'Downloading'|'DownloadingTrainingImage'|'Training'|'Uploading'|'Stopping'|'Stopped'|'MaxRuntimeExceeded'|'Completed'|'Failed',
    'FailureReason': 'string',
    'HyperParameters': {
        'string': 'string'
    },
    'AlgorithmSpecification': {
        'TrainingImage': 'string',
        'AlgorithmName': 'string',
        'TrainingInputMode': 'Pipe'|'File',
        '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': 123
            }
        },
    ],
    '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': 123,
        'VolumeSizeInGB': 123,
        'VolumeKmsKeyId': 'string'
    },
    'VpcConfig': {
        'SecurityGroupIds': [
            'string',
        ],
        'Subnets': [
            'string',
        ]
    },
    'StoppingCondition': {
        'MaxRuntimeInSeconds': 123
    },
    'CreationTime': datetime(2015, 1, 1),
    'TrainingStartTime': datetime(2015, 1, 1),
    'TrainingEndTime': datetime(2015, 1, 1),
    'LastModifiedTime': datetime(2015, 1, 1),
    'SecondaryStatusTransitions': [
        {
            'Status': 'Starting'|'LaunchingMLInstances'|'PreparingTrainingStack'|'Downloading'|'DownloadingTrainingImage'|'Training'|'Uploading'|'Stopping'|'Stopped'|'MaxRuntimeExceeded'|'Completed'|'Failed',
            'StartTime': datetime(2015, 1, 1),
            'EndTime': datetime(2015, 1, 1),
            'StatusMessage': 'string'
        },
    ],
    'FinalMetricDataList': [
        {
            'MetricName': 'string',
            'Value': ...,
            'Timestamp': datetime(2015, 1, 1)
        },
    ],
    'EnableNetworkIsolation': True|False,
    'EnableInterContainerTrafficEncryption': True|False
}

Response Structure

  • (dict) --

    • TrainingJobName (string) --

      Name of the model training job.

    • TrainingJobArn (string) --

      The Amazon Resource Name (ARN) of the training job.

    • TuningJobArn (string) --

      The Amazon Resource Name (ARN) of the associated hyperparameter tuning job if the training job was launched by a hyperparameter tuning job.

    • LabelingJobArn (string) --

      The Amazon Resource Name (ARN) of the Amazon SageMaker Ground Truth labeling job that created the transform or training job.

    • ModelArtifacts (dict) --

      Information about the Amazon S3 location that is configured for storing model artifacts.

      • S3ModelArtifacts (string) --

        The path of the S3 object that contains the model artifacts. For example, s3://bucket-name/keynameprefix/model.tar.gz .

    • TrainingJobStatus (string) --

      The status of the training job.

      Amazon SageMaker provides the following training job statuses:

      • InProgress - The training is in progress.

      • Completed - The training job has completed.

      • Failed - The training job has failed. To see the reason for the failure, see the FailureReason field in the response to a DescribeTrainingJobResponse call.

      • Stopping - The training job is stopping.

      • Stopped - The training job has stopped.

      For more detailed information, see SecondaryStatus .

    • SecondaryStatus (string) --

      Provides detailed information about the state of the training job. For detailed information on the secondary status of the training job, see StatusMessage under SecondaryStatusTransition.

      Amazon SageMaker provides primary statuses and secondary statuses that apply to each of them:

      InProgress

      • Starting - Starting the training job.

      • Downloading - An optional stage for algorithms that support File training input mode. It indicates that data is being downloaded to the ML storage volumes.

      • Training - Training is in progress.

      • Uploading - Training is complete and the model artifacts are being uploaded to the S3 location.

        Completed

      • Completed - The training job has completed.

        Failed

      • Failed - The training job has failed. The reason for the failure is returned in the FailureReason field of DescribeTrainingJobResponse .

        Stopped

      • MaxRuntimeExceeded - The job stopped because it exceeded the maximum allowed runtime.

      • Stopped - The training job has stopped.

        Stopping

      • Stopping - Stopping the training job.

      Warning

      Valid values for SecondaryStatus are subject to change.

      We no longer support the following secondary statuses:

      • LaunchingMLInstances

      • PreparingTrainingStack

      • DownloadingTrainingImage

    • FailureReason (string) --

      If the training job failed, the reason it failed.

    • HyperParameters (dict) --

      Algorithm-specific parameters.

      • (string) --

        • (string) --

    • AlgorithmSpecification (dict) --

      Information about the algorithm used for training, and algorithm metadata.

      • TrainingImage (string) --

        The registry path of the Docker image that contains the training algorithm. For information about docker registry paths for built-in algorithms, see Algorithms Provided by Amazon SageMaker: Common Parameters.

      • AlgorithmName (string) --

        The name of the algorithm resource to use for the training job. This must be an algorithm resource that you created or subscribe to on AWS Marketplace. If you specify a value for this parameter, you can't specify a value for TrainingImage .

      • TrainingInputMode (string) --

        The input mode that the algorithm supports. For the input modes that Amazon SageMaker algorithms support, see Algorithms. If an algorithm supports the File input mode, Amazon SageMaker downloads the training data from S3 to the provisioned ML storage Volume, and mounts the directory to docker volume for training container. If an algorithm supports the Pipe input mode, Amazon SageMaker streams data directly from S3 to the container.

        In File mode, make sure you provision ML storage volume with sufficient capacity to accommodate the data download from S3. In addition to the training data, the ML storage volume also stores the output model. The algorithm container use ML storage volume to also store intermediate information, if any.

        For distributed algorithms using File mode, training data is distributed uniformly, and your training duration is predictable if the input data objects size is approximately same. Amazon SageMaker does not split the files any further for model training. If the object sizes are skewed, training won't be optimal as the data distribution is also skewed where one host in a training cluster is overloaded, thus becoming bottleneck in training.

      • MetricDefinitions (list) --

        A list of metric definition objects. Each object specifies the metric name and regular expressions used to parse algorithm logs. Amazon SageMaker publishes each metric to Amazon CloudWatch.

        • (dict) --

          Specifies a metric that the training algorithm writes to stderr or stdout . Amazon SageMakerhyperparameter tuning captures all defined metrics. You specify one metric that a hyperparameter tuning job uses as its objective metric to choose the best training job.

          • Name (string) --

            The name of the metric.

          • Regex (string) --

            A regular expression that searches the output of a training job and gets the value of the metric. For more information about using regular expressions to define metrics, see Defining Objective Metrics.

    • RoleArn (string) --

      The AWS Identity and Access Management (IAM) role configured for the training job.

    • InputDataConfig (list) --

      An array of Channel objects that describes each data input channel.

      • (dict) --

        A channel is a named input source that training algorithms can consume.

        • ChannelName (string) --

          The name of the channel.

        • DataSource (dict) --

          The location of the channel data.

          • S3DataSource (dict) --

            The S3 location of the data source that is associated with a channel.

            • S3DataType (string) --

              If you choose S3Prefix , S3Uri identifies a key name prefix. Amazon SageMaker uses all objects that match the specified key name prefix for model training.

              If you choose ManifestFile , S3Uri identifies an object that is a manifest file containing a list of object keys that you want Amazon SageMaker to use for model training.

              If you choose AugmentedManifestFile , S3Uri identifies an object that is an augmented manifest file in JSON lines format. This file contains the data you want to use for model training. AugmentedManifestFile can only be used if the Channel's input mode is Pipe .

            • S3Uri (string) --

              Depending on the value specified for the S3DataType , identifies either a key name prefix or a manifest. For example:

              • A key name prefix might look like this: s3://bucketname/exampleprefix .

              • A manifest might look like this: s3://bucketname/example.manifest The manifest is an S3 object which is a JSON file with the following format: [ {"prefix": "s3://customer_bucket/some/prefix/"}, "relative/path/to/custdata-1", "relative/path/custdata-2", ... ] The preceding JSON matches the following s3Uris : s3://customer_bucket/some/prefix/relative/path/to/custdata-1 s3://customer_bucket/some/prefix/relative/path/custdata-2 ... The complete set of s3uris in this manifest is the input data for the channel for this datasource. The object that each s3uris points to must be readable by the IAM role that Amazon SageMaker uses to perform tasks on your behalf.

            • S3DataDistributionType (string) --

              If you want Amazon SageMaker to replicate the entire dataset on each ML compute instance that is launched for model training, specify FullyReplicated .

              If you want Amazon SageMaker to replicate a subset of data on each ML compute instance that is launched for model training, specify ShardedByS3Key . If there are n ML compute instances launched for a training job, each instance gets approximately 1/n of the number of S3 objects. In this case, model training on each machine uses only the subset of training data.

              Don't choose more ML compute instances for training than available S3 objects. If you do, some nodes won't get any data and you will pay for nodes that aren't getting any training data. This applies in both File and Pipe modes. Keep this in mind when developing algorithms.

              In distributed training, where you use multiple ML compute EC2 instances, you might choose ShardedByS3Key . If the algorithm requires copying training data to the ML storage volume (when TrainingInputMode is set to File ), this copies 1/n of the number of objects.

            • AttributeNames (list) --

              A list of one or more attribute names to use that are found in a specified augmented manifest file.

              • (string) --

        • ContentType (string) --

          The MIME type of the data.

        • CompressionType (string) --

          If training data is compressed, the compression type. The default value is None . CompressionType is used only in Pipe input mode. In File mode, leave this field unset or set it to None.

        • RecordWrapperType (string) --

          Specify RecordIO as the value when input data is in raw format but the training algorithm requires the RecordIO format. In this case, Amazon SageMaker wraps each individual S3 object in a RecordIO record. If the input data is already in RecordIO format, you don't need to set this attribute. For more information, see Create a Dataset Using RecordIO.

          In File mode, leave this field unset or set it to None.

        • InputMode (string) --

          (Optional) The input mode to use for the data channel in a training job. If you don't set a value for InputMode , Amazon SageMaker uses the value set for TrainingInputMode . Use this parameter to override the TrainingInputMode setting in a AlgorithmSpecification request when you have a channel that needs a different input mode from the training job's general setting. To download the data from Amazon Simple Storage Service (Amazon S3) to the provisioned ML storage volume, and mount the directory to a Docker volume, use File input mode. To stream data directly from Amazon S3 to the container, choose Pipe input mode.

          To use a model for incremental training, choose File input model.

        • ShuffleConfig (dict) --

          A configuration for a shuffle option for input data in a channel. If you use S3Prefix for S3DataType , this shuffles the results of the S3 key prefix matches. If you use ManifestFile , the order of the S3 object references in the ManifestFile is shuffled. If you use AugmentedManifestFile , the order of the JSON lines in the AugmentedManifestFile is shuffled. The shuffling order is determined using the Seed value.

          For Pipe input mode, shuffling is done at the start of every epoch. With large datasets this ensures that the order of the training data is different for each epoch, it helps reduce bias and possible overfitting. In a multi-node training job when ShuffleConfig is combined with S3DataDistributionType of ShardedByS3Key , the data is shuffled across nodes so that the content sent to a particular node on the first epoch might be sent to a different node on the second epoch.

          • Seed (integer) --

            Determines the shuffling order in ShuffleConfig value.

    • OutputDataConfig (dict) --

      The S3 path where model artifacts that you configured when creating the job are stored. Amazon SageMaker creates subfolders for model artifacts.

      • KmsKeyId (string) --

        The AWS Key Management Service (AWS KMS) key that Amazon SageMaker uses to encrypt the model artifacts at rest using Amazon S3 server-side encryption. The KmsKeyId can be any of the following formats:

        • // KMS Key ID "1234abcd-12ab-34cd-56ef-1234567890ab"

        • // Amazon Resource Name (ARN) of a KMS Key "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"

        • // KMS Key Alias "alias/ExampleAlias"

        • // Amazon Resource Name (ARN) of a KMS Key Alias "arn:aws:kms:us-west-2:111122223333:alias/ExampleAlias"

        If you don't provide a KMS key ID, Amazon SageMaker uses the default KMS key for Amazon S3 for your role's account. For more information, see KMS-Managed Encryption Keys in the Amazon Simple Storage Service Developer Guide.

        The KMS key policy must grant permission to the IAM role that you specify in your CreateTramsformJob request. For more information, see Using Key Policies in AWS KMS in the AWS Key Management Service Developer Guide .

      • S3OutputPath (string) --

        Identifies the S3 path where you want Amazon SageMaker to store the model artifacts. For example, s3://bucket-name/key-name-prefix .

    • ResourceConfig (dict) --

      Resources, including ML compute instances and ML storage volumes, that are configured for model training.

      • InstanceType (string) --

        The ML compute instance type.

      • InstanceCount (integer) --

        The number of ML compute instances to use. For distributed training, provide a value greater than 1.

      • VolumeSizeInGB (integer) --

        The size of the ML storage volume that you want to provision.

        ML storage volumes store model artifacts and incremental states. Training algorithms might also use the ML storage volume for scratch space. If you want to store the training data in the ML storage volume, choose File as the TrainingInputMode in the algorithm specification.

        You must specify sufficient ML storage for your scenario.

        Note

        Amazon SageMaker supports only the General Purpose SSD (gp2) ML storage volume type.

      • VolumeKmsKeyId (string) --

        The AWS Key Management Service (AWS KMS) key that Amazon SageMaker uses to encrypt data on the storage volume attached to the ML compute instance(s) that run the training job. The VolumeKmsKeyId can be any of the following formats:

        • // KMS Key ID "1234abcd-12ab-34cd-56ef-1234567890ab"

        • // Amazon Resource Name (ARN) of a KMS Key "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"

    • VpcConfig (dict) --

      A VpcConfig object that specifies the VPC that this training job has access to. For more information, see Protect Training Jobs by Using an Amazon Virtual Private Cloud.

      • SecurityGroupIds (list) --

        The VPC security group IDs, in the form sg-xxxxxxxx. Specify the security groups for the VPC that is specified in the Subnets field.

        • (string) --

      • Subnets (list) --

        The ID of the subnets in the VPC to which you want to connect your training job or model.

        • (string) --

    • StoppingCondition (dict) --

      The condition under which to stop the training job.

      • MaxRuntimeInSeconds (integer) --

        The maximum length of time, in seconds, that the training job can run. If model training does not complete during this time, Amazon SageMaker ends the job. If value is not specified, default value is 1 day. Maximum value is 28 days.

    • CreationTime (datetime) --

      A timestamp that indicates when the training job was created.

    • TrainingStartTime (datetime) --

      Indicates the time when the training job starts on training instances. You are billed for the time interval between this time and the value of TrainingEndTime . The start time in CloudWatch Logs might be later than this time. The difference is due to the time it takes to download the training data and to the size of the training container.

    • TrainingEndTime (datetime) --

      Indicates the time when the training job ends on training instances. You are billed for the time interval between the value of TrainingStartTime and this time. For successful jobs and stopped jobs, this is the time after model artifacts are uploaded. For failed jobs, this is the time when Amazon SageMaker detects a job failure.

    • LastModifiedTime (datetime) --

      A timestamp that indicates when the status of the training job was last modified.

    • SecondaryStatusTransitions (list) --

      A history of all of the secondary statuses that the training job has transitioned through.

      • (dict) --

        An array element of DescribeTrainingJobResponse$SecondaryStatusTransitions. It provides additional details about a status that the training job has transitioned through. A training job can be in one of several states, for example, starting, downloading, training, or uploading. Within each state, there are a number of intermediate states. For example, within the starting state, Amazon SageMaker could be starting the training job or launching the ML instances. These transitional states are referred to as the job's secondary status.

        • Status (string) --

          Contains a secondary status information from a training job.

          Status might be one of the following secondary statuses:

          InProgress

          • Starting - Starting the training job.

          • Downloading - An optional stage for algorithms that support File training input mode. It indicates that data is being downloaded to the ML storage volumes.

          • Training - Training is in progress.

          • Uploading - Training is complete and the model artifacts are being uploaded to the S3 location.

            Completed

          • Completed - The training job has completed.

            Failed

          • Failed - The training job has failed. The reason for the failure is returned in the FailureReason field of DescribeTrainingJobResponse .

            Stopped

          • MaxRuntimeExceeded - The job stopped because it exceeded the maximum allowed runtime.

          • Stopped - The training job has stopped.

            Stopping

          • Stopping - Stopping the training job.

          We no longer support the following secondary statuses:

          • LaunchingMLInstances

          • PreparingTrainingStack

          • DownloadingTrainingImage

        • StartTime (datetime) --

          A timestamp that shows when the training job transitioned to the current secondary status state.

        • EndTime (datetime) --

          A timestamp that shows when the training job transitioned out of this secondary status state into another secondary status state or when the training job has ended.

        • StatusMessage (string) --

          A detailed description of the progress within a secondary status.

          Amazon SageMaker provides secondary statuses and status messages that apply to each of them:

          Starting

          • Starting the training job.

          • Launching requested ML instances.

          • Insufficient capacity error from EC2 while launching instances, retrying!

          • Launched instance was unhealthy, replacing it!

          • Preparing the instances for training.

            Training

          • Downloading the training image.

          • Training image download completed. Training in progress.

          Warning

          Status messages are subject to change. Therefore, we recommend not including them in code that programmatically initiates actions. For examples, don't use status messages in if statements.

          To have an overview of your training job's progress, view TrainingJobStatus and SecondaryStatus in DescribeTrainingJobResponse, and StatusMessage together. For example, at the start of a training job, you might see the following:

          • TrainingJobStatus - InProgress

          • SecondaryStatus - Training

          • StatusMessage - Downloading the training image

    • FinalMetricDataList (list) --

      A collection of MetricData objects that specify the names, values, and dates and times that the training algorithm emitted to Amazon CloudWatch.

      • (dict) --

        The name, value, and date and time of a metric that was emitted to Amazon CloudWatch.

        • MetricName (string) --

          The name of the metric.

        • Value (float) --

          The value of the metric.

        • Timestamp (datetime) --

          The date and time that the algorithm emitted the metric.

    • EnableNetworkIsolation (boolean) --

      If you want to allow inbound or outbound network calls, except for calls between peers within a training cluster for distributed training, choose True . If you enable network isolation for training jobs that are configured to use a VPC, Amazon SageMaker downloads and uploads customer data and model artifacts through the specified VPC, but the training container does not have network access.

      Note

      The Semantic Segmentation built-in algorithm does not support network isolation.

    • EnableInterContainerTrafficEncryption (boolean) --

      To encrypt all communications between ML compute instances in distributed training, specify True . Encryption provides greater security for distributed training, but training take longer because of the additional communications between ML compute instances.