pub struct Builder { /* private fields */ }
Expand description
A builder for HyperParameterTrainingJobDefinition
.
Implementations§
source§impl Builder
impl Builder
sourcepub fn definition_name(self, input: impl Into<String>) -> Self
pub fn definition_name(self, input: impl Into<String>) -> Self
The job definition name.
sourcepub fn set_definition_name(self, input: Option<String>) -> Self
pub fn set_definition_name(self, input: Option<String>) -> Self
The job definition name.
sourcepub fn tuning_objective(self, input: HyperParameterTuningJobObjective) -> Self
pub fn tuning_objective(self, input: HyperParameterTuningJobObjective) -> Self
Defines the objective metric for a hyperparameter tuning job. Hyperparameter tuning uses the value of this metric to evaluate the training jobs it launches, and returns the training job that results in either the highest or lowest value for this metric, depending on the value you specify for the Type
parameter.
sourcepub fn set_tuning_objective(
self,
input: Option<HyperParameterTuningJobObjective>
) -> Self
pub fn set_tuning_objective(
self,
input: Option<HyperParameterTuningJobObjective>
) -> Self
Defines the objective metric for a hyperparameter tuning job. Hyperparameter tuning uses the value of this metric to evaluate the training jobs it launches, and returns the training job that results in either the highest or lowest value for this metric, depending on the value you specify for the Type
parameter.
sourcepub fn hyper_parameter_ranges(self, input: ParameterRanges) -> Self
pub fn hyper_parameter_ranges(self, input: ParameterRanges) -> Self
Specifies ranges of integer, continuous, and categorical hyperparameters that a hyperparameter tuning job searches. The hyperparameter tuning job launches training jobs with hyperparameter values within these ranges to find the combination of values that result in the training job with the best performance as measured by the objective metric of the hyperparameter tuning job.
The maximum number of items specified for Array Members
refers to the maximum number of hyperparameters for each range and also the maximum for the hyperparameter tuning job itself. That is, the sum of the number of hyperparameters for all the ranges can't exceed the maximum number specified.
sourcepub fn set_hyper_parameter_ranges(self, input: Option<ParameterRanges>) -> Self
pub fn set_hyper_parameter_ranges(self, input: Option<ParameterRanges>) -> Self
Specifies ranges of integer, continuous, and categorical hyperparameters that a hyperparameter tuning job searches. The hyperparameter tuning job launches training jobs with hyperparameter values within these ranges to find the combination of values that result in the training job with the best performance as measured by the objective metric of the hyperparameter tuning job.
The maximum number of items specified for Array Members
refers to the maximum number of hyperparameters for each range and also the maximum for the hyperparameter tuning job itself. That is, the sum of the number of hyperparameters for all the ranges can't exceed the maximum number specified.
sourcepub fn static_hyper_parameters(
self,
k: impl Into<String>,
v: impl Into<String>
) -> Self
pub fn static_hyper_parameters(
self,
k: impl Into<String>,
v: impl Into<String>
) -> Self
Adds a key-value pair to static_hyper_parameters
.
To override the contents of this collection use set_static_hyper_parameters
.
Specifies the values of hyperparameters that do not change for the tuning job.
sourcepub fn set_static_hyper_parameters(
self,
input: Option<HashMap<String, String>>
) -> Self
pub fn set_static_hyper_parameters(
self,
input: Option<HashMap<String, String>>
) -> Self
Specifies the values of hyperparameters that do not change for the tuning job.
sourcepub fn algorithm_specification(
self,
input: HyperParameterAlgorithmSpecification
) -> Self
pub fn algorithm_specification(
self,
input: HyperParameterAlgorithmSpecification
) -> Self
The HyperParameterAlgorithmSpecification
object that specifies the resource algorithm to use for the training jobs that the tuning job launches.
sourcepub fn set_algorithm_specification(
self,
input: Option<HyperParameterAlgorithmSpecification>
) -> Self
pub fn set_algorithm_specification(
self,
input: Option<HyperParameterAlgorithmSpecification>
) -> Self
The HyperParameterAlgorithmSpecification
object that specifies the resource algorithm to use for the training jobs that the tuning job launches.
sourcepub fn role_arn(self, input: impl Into<String>) -> Self
pub fn role_arn(self, input: impl Into<String>) -> Self
The Amazon Resource Name (ARN) of the IAM role associated with the training jobs that the tuning job launches.
sourcepub fn set_role_arn(self, input: Option<String>) -> Self
pub fn set_role_arn(self, input: Option<String>) -> Self
The Amazon Resource Name (ARN) of the IAM role associated with the training jobs that the tuning job launches.
sourcepub fn input_data_config(self, input: Channel) -> Self
pub fn input_data_config(self, input: Channel) -> Self
Appends an item to input_data_config
.
To override the contents of this collection use set_input_data_config
.
An array of Channel
objects that specify the input for the training jobs that the tuning job launches.
sourcepub fn set_input_data_config(self, input: Option<Vec<Channel>>) -> Self
pub fn set_input_data_config(self, input: Option<Vec<Channel>>) -> Self
An array of Channel
objects that specify the input for the training jobs that the tuning job launches.
sourcepub fn vpc_config(self, input: VpcConfig) -> Self
pub fn vpc_config(self, input: VpcConfig) -> Self
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.
sourcepub fn set_vpc_config(self, input: Option<VpcConfig>) -> Self
pub fn set_vpc_config(self, input: Option<VpcConfig>) -> Self
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.
sourcepub fn output_data_config(self, input: OutputDataConfig) -> Self
pub fn output_data_config(self, input: OutputDataConfig) -> Self
Specifies the path to the Amazon S3 bucket where you store model artifacts from the training jobs that the tuning job launches.
sourcepub fn set_output_data_config(self, input: Option<OutputDataConfig>) -> Self
pub fn set_output_data_config(self, input: Option<OutputDataConfig>) -> Self
Specifies the path to the Amazon S3 bucket where you store model artifacts from the training jobs that the tuning job launches.
sourcepub fn resource_config(self, input: ResourceConfig) -> Self
pub fn resource_config(self, input: ResourceConfig) -> Self
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.
sourcepub fn set_resource_config(self, input: Option<ResourceConfig>) -> Self
pub fn set_resource_config(self, input: Option<ResourceConfig>) -> Self
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.
sourcepub fn stopping_condition(self, input: StoppingCondition) -> Self
pub fn stopping_condition(self, input: StoppingCondition) -> Self
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.
sourcepub fn set_stopping_condition(self, input: Option<StoppingCondition>) -> Self
pub fn set_stopping_condition(self, input: Option<StoppingCondition>) -> Self
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.
sourcepub fn enable_network_isolation(self, input: bool) -> Self
pub fn enable_network_isolation(self, input: bool) -> Self
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.
sourcepub fn set_enable_network_isolation(self, input: Option<bool>) -> Self
pub fn set_enable_network_isolation(self, input: Option<bool>) -> Self
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.
sourcepub fn enable_inter_container_traffic_encryption(self, input: bool) -> Self
pub fn enable_inter_container_traffic_encryption(self, input: bool) -> Self
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.
sourcepub fn set_enable_inter_container_traffic_encryption(
self,
input: Option<bool>
) -> Self
pub fn set_enable_inter_container_traffic_encryption(
self,
input: Option<bool>
) -> Self
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.
sourcepub fn enable_managed_spot_training(self, input: bool) -> Self
pub fn enable_managed_spot_training(self, input: bool) -> Self
A Boolean indicating whether managed spot training is enabled (True
) or not (False
).
sourcepub fn set_enable_managed_spot_training(self, input: Option<bool>) -> Self
pub fn set_enable_managed_spot_training(self, input: Option<bool>) -> Self
A Boolean indicating whether managed spot training is enabled (True
) or not (False
).
sourcepub fn checkpoint_config(self, input: CheckpointConfig) -> Self
pub fn checkpoint_config(self, input: CheckpointConfig) -> Self
Contains information about the output location for managed spot training checkpoint data.
sourcepub fn set_checkpoint_config(self, input: Option<CheckpointConfig>) -> Self
pub fn set_checkpoint_config(self, input: Option<CheckpointConfig>) -> Self
Contains information about the output location for managed spot training checkpoint data.
sourcepub fn retry_strategy(self, input: RetryStrategy) -> Self
pub fn retry_strategy(self, input: RetryStrategy) -> Self
The number of times to retry the job when the job fails due to an InternalServerError
.
sourcepub fn set_retry_strategy(self, input: Option<RetryStrategy>) -> Self
pub fn set_retry_strategy(self, input: Option<RetryStrategy>) -> Self
The number of times to retry the job when the job fails due to an InternalServerError
.
sourcepub fn hyper_parameter_tuning_resource_config(
self,
input: HyperParameterTuningResourceConfig
) -> Self
pub fn hyper_parameter_tuning_resource_config(
self,
input: HyperParameterTuningResourceConfig
) -> Self
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).
sourcepub fn set_hyper_parameter_tuning_resource_config(
self,
input: Option<HyperParameterTuningResourceConfig>
) -> Self
pub fn set_hyper_parameter_tuning_resource_config(
self,
input: Option<HyperParameterTuningResourceConfig>
) -> Self
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).
sourcepub fn environment(self, k: impl Into<String>, v: impl Into<String>) -> Self
pub fn environment(self, k: impl Into<String>, v: impl Into<String>) -> Self
Adds a key-value pair to environment
.
To override the contents of this collection use set_environment
.
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.
sourcepub fn set_environment(self, input: Option<HashMap<String, String>>) -> Self
pub fn set_environment(self, input: Option<HashMap<String, String>>) -> Self
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.
sourcepub fn build(self) -> HyperParameterTrainingJobDefinition
pub fn build(self) -> HyperParameterTrainingJobDefinition
Consumes the builder and constructs a HyperParameterTrainingJobDefinition
.