Skip to content

HyperParameterTrainingJobDefinition

Source code in docs_src/capo_sagemaker/types/hyper_parameter_training_job_definition.py
class HyperParameterTrainingJobDefinition(TypedDict, closed=True):
    definition_name: NotRequired[
        "capo_sagemaker.types.hyper_parameter_training_job_definition_name.HyperParameterTrainingJobDefinitionName"
    ]
    """<p>The job definition name.</p>"""
    tuning_objective: NotRequired[
        "capo_sagemaker.types.hyper_parameter_tuning_job_objective.HyperParameterTuningJobObjective"
    ]
    hyper_parameter_ranges: NotRequired[
        "capo_sagemaker.types.parameter_ranges.ParameterRanges"
    ]
    static_hyper_parameters: NotRequired[
        "capo_sagemaker.types.hyper_parameters.HyperParameters"
    ]
    """<p>Specifies the values of hyperparameters that do not change for the tuning job.</p>"""
    algorithm_specification: NotRequired[
        "capo_sagemaker.types.hyper_parameter_algorithm_specification.HyperParameterAlgorithmSpecification"
    ]
    """<p>The <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_HyperParameterAlgorithmSpecification.html">HyperParameterAlgorithmSpecification</a> object that specifies the resource algorithm to use for the training jobs that the tuning job launches.</p>"""
    role_arn: NotRequired["capo_sagemaker.types.role_arn.RoleArn"]
    """<p>The Amazon Resource Name (ARN) of the IAM role associated with the training jobs that the tuning job launches.</p>"""
    input_data_config: NotRequired[
        "capo_sagemaker.types.input_data_config.InputDataConfig"
    ]
    """<p>An array of <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_Channel.html">Channel</a> objects that specify the input for the training jobs that the tuning job launches.</p>"""
    vpc_config: NotRequired["capo_sagemaker.types.vpc_config.VpcConfig"]
    """<p>The <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_VpcConfig.html">VpcConfig</a> 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 <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/train-vpc.html">Protect Training Jobs by Using an Amazon Virtual Private Cloud</a>.</p>"""
    output_data_config: NotRequired[
        "capo_sagemaker.types.output_data_config.OutputDataConfig"
    ]
    """<p>Specifies the path to the Amazon S3 bucket where you store model artifacts from the training jobs that the tuning job launches.</p>"""
    resource_config: NotRequired["capo_sagemaker.types.resource_config.ResourceConfig"]
    """<p>The resources, including the compute instances and storage volumes, to use for the training jobs that the tuning job launches.</p> <p>Storage volumes store model artifacts and incremental states. Training algorithms might also use storage volumes for scratch space. If you want SageMaker to use the storage volume to store the training data, choose <code>File</code> as the <code>TrainingInputMode</code> in the algorithm specification. For distributed training algorithms, specify an instance count greater than 1.</p> <note> <p>If you want to use hyperparameter optimization with instance type flexibility, use <code>HyperParameterTuningResourceConfig</code> instead.</p> </note>"""
    hyper_parameter_tuning_resource_config: NotRequired[
        "capo_sagemaker.types.hyper_parameter_tuning_resource_config.HyperParameterTuningResourceConfig"
    ]
    """<p>The configuration for the hyperparameter tuning resources, including the compute instances and storage volumes, used for training jobs launched by the tuning job. By default, storage volumes hold model artifacts and incremental states. Choose <code>File</code> for <code>TrainingInputMode</code> in the <code>AlgorithmSpecification</code> parameter to additionally store training data in the storage volume (optional).</p>"""
    stopping_condition: NotRequired[
        "capo_sagemaker.types.stopping_condition.StoppingCondition"
    ]
    """<p>Specifies a limit to how long a model hyperparameter training job can run. It also specifies how long a managed spot training job has to complete. When the job reaches the time limit, SageMaker ends the training job. Use this API to cap model training costs.</p>"""
    enable_network_isolation: NotRequired["capo_sagemaker.types.boolean.Boolean"]
    """<p>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, SageMaker downloads and uploads customer data and model artifacts through the specified VPC, but the training container does not have network access.</p>"""
    enable_inter_container_traffic_encryption: NotRequired[
        "capo_sagemaker.types.boolean.Boolean"
    ]
    """<p>To encrypt all communications between ML compute instances in distributed training, choose <code>True</code>. Encryption provides greater security for distributed training, but training might take longer. How long it takes depends on the amount of communication between compute instances, especially if you use a deep learning algorithm in distributed training.</p>"""
    enable_managed_spot_training: NotRequired["capo_sagemaker.types.boolean.Boolean"]
    """<p>A Boolean indicating whether managed spot training is enabled (<code>True</code>) or not (<code>False</code>).</p>"""
    checkpoint_config: NotRequired[
        "capo_sagemaker.types.checkpoint_config.CheckpointConfig"
    ]
    retry_strategy: NotRequired["capo_sagemaker.types.retry_strategy.RetryStrategy"]
    """<p>The number of times to retry the job when the job fails due to an <code>InternalServerError</code>.</p>"""
    environment: NotRequired[
        "capo_sagemaker.types.hyper_parameter_training_job_environment_map.HyperParameterTrainingJobEnvironmentMap"
    ]
    """<p>An environment variable that you can pass into the SageMaker <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateTrainingJob.html">CreateTrainingJob</a> API. You can use an existing <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateTrainingJob.html#sagemaker-CreateTrainingJob-request-Environment">environment variable from the training container</a> or use your own. See <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/automatic-model-tuning-define-metrics-variables.html">Define metrics and variables</a> for more information.</p> <note> <p>The maximum number of items specified for <code>Map Entries</code> refers to the maximum number of environment variables for each <code>TrainingJobDefinition</code> and also the maximum for the hyperparameter tuning job itself. That is, the sum of the number of environment variables for all the training job definitions can't exceed the maximum number specified.</p> </note>"""

algorithm_specification instance-attribute

algorithm_specification: NotRequired[HyperParameterAlgorithmSpecification]

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

checkpoint_config instance-attribute

checkpoint_config: NotRequired[CheckpointConfig]

definition_name instance-attribute

definition_name: NotRequired[HyperParameterTrainingJobDefinitionName]

The job definition name.

enable_inter_container_traffic_encryption instance-attribute

enable_inter_container_traffic_encryption: NotRequired[Boolean]

To encrypt all communications between ML compute instances in distributed training, choose True. Encryption provides greater security for distributed training, but training might take longer. How long it takes depends on the amount of communication between compute instances, especially if you use a deep learning algorithm in distributed training.

enable_managed_spot_training instance-attribute

enable_managed_spot_training: NotRequired[Boolean]

A Boolean indicating whether managed spot training is enabled (True) or not (False).

enable_network_isolation instance-attribute

enable_network_isolation: NotRequired[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, SageMaker downloads and uploads customer data and model artifacts through the specified VPC, but the training container does not have network access.

environment instance-attribute

environment: NotRequired[HyperParameterTrainingJobEnvironmentMap]

An environment variable that you can pass into the SageMaker CreateTrainingJob API. You can use an existing environment variable from the training container or use your own. See Define metrics and variables for more information.

The maximum number of items specified for Map Entries refers to the maximum number of environment variables for each TrainingJobDefinition and also the maximum for the hyperparameter tuning job itself. That is, the sum of the number of environment variables for all the training job definitions can't exceed the maximum number specified.

hyper_parameter_ranges instance-attribute

hyper_parameter_ranges: NotRequired[ParameterRanges]

hyper_parameter_tuning_resource_config instance-attribute

hyper_parameter_tuning_resource_config: NotRequired[HyperParameterTuningResourceConfig]

The configuration for the hyperparameter tuning resources, including the compute instances and storage volumes, used for training jobs launched by the tuning job. By default, storage volumes hold model artifacts and incremental states. Choose File for TrainingInputMode in the AlgorithmSpecification parameter to additionally store training data in the storage volume (optional).

input_data_config instance-attribute

input_data_config: NotRequired[InputDataConfig]

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

output_data_config instance-attribute

output_data_config: NotRequired[OutputDataConfig]

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

resource_config instance-attribute

resource_config: NotRequired[ResourceConfig]

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

If you want to use hyperparameter optimization with instance type flexibility, use HyperParameterTuningResourceConfig instead.

retry_strategy instance-attribute

retry_strategy: NotRequired[RetryStrategy]

The number of times to retry the job when the job fails due to an InternalServerError.

role_arn instance-attribute

role_arn: NotRequired[RoleArn]

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

static_hyper_parameters instance-attribute

static_hyper_parameters: NotRequired[HyperParameters]

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

stopping_condition instance-attribute

stopping_condition: NotRequired[StoppingCondition]

Specifies a limit to how long a model hyperparameter training job can run. It also specifies how long a managed spot training job has to complete. When the job reaches the time limit, SageMaker ends the training job. Use this API to cap model training costs.

tuning_objective instance-attribute

tuning_objective: NotRequired[HyperParameterTuningJobObjective]

vpc_config instance-attribute

vpc_config: NotRequired[VpcConfig]

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.