Struct aws_sdk_sagemaker::model::training_job::Builder
source · pub struct Builder { /* private fields */ }
Expand description
A builder for TrainingJob
.
Implementations§
source§impl Builder
impl Builder
sourcepub fn training_job_name(self, input: impl Into<String>) -> Self
pub fn training_job_name(self, input: impl Into<String>) -> Self
The name of the training job.
sourcepub fn set_training_job_name(self, input: Option<String>) -> Self
pub fn set_training_job_name(self, input: Option<String>) -> Self
The name of the training job.
sourcepub fn training_job_arn(self, input: impl Into<String>) -> Self
pub fn training_job_arn(self, input: impl Into<String>) -> Self
The Amazon Resource Name (ARN) of the training job.
sourcepub fn set_training_job_arn(self, input: Option<String>) -> Self
pub fn set_training_job_arn(self, input: Option<String>) -> Self
The Amazon Resource Name (ARN) of the training job.
sourcepub fn tuning_job_arn(self, input: impl Into<String>) -> Self
pub fn tuning_job_arn(self, input: impl Into<String>) -> Self
The Amazon Resource Name (ARN) of the associated hyperparameter tuning job if the training job was launched by a hyperparameter tuning job.
sourcepub fn set_tuning_job_arn(self, input: Option<String>) -> Self
pub fn set_tuning_job_arn(self, input: Option<String>) -> Self
The Amazon Resource Name (ARN) of the associated hyperparameter tuning job if the training job was launched by a hyperparameter tuning job.
sourcepub fn labeling_job_arn(self, input: impl Into<String>) -> Self
pub fn labeling_job_arn(self, input: impl Into<String>) -> Self
The Amazon Resource Name (ARN) of the labeling job.
sourcepub fn set_labeling_job_arn(self, input: Option<String>) -> Self
pub fn set_labeling_job_arn(self, input: Option<String>) -> Self
The Amazon Resource Name (ARN) of the labeling job.
sourcepub fn auto_ml_job_arn(self, input: impl Into<String>) -> Self
pub fn auto_ml_job_arn(self, input: impl Into<String>) -> Self
The Amazon Resource Name (ARN) of the job.
sourcepub fn set_auto_ml_job_arn(self, input: Option<String>) -> Self
pub fn set_auto_ml_job_arn(self, input: Option<String>) -> Self
The Amazon Resource Name (ARN) of the job.
sourcepub fn model_artifacts(self, input: ModelArtifacts) -> Self
pub fn model_artifacts(self, input: ModelArtifacts) -> Self
Information about the Amazon S3 location that is configured for storing model artifacts.
sourcepub fn set_model_artifacts(self, input: Option<ModelArtifacts>) -> Self
pub fn set_model_artifacts(self, input: Option<ModelArtifacts>) -> Self
Information about the Amazon S3 location that is configured for storing model artifacts.
sourcepub fn training_job_status(self, input: TrainingJobStatus) -> Self
pub fn training_job_status(self, input: TrainingJobStatus) -> Self
The status of the training job.
Training job statuses are:
-
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 theFailureReason
field in the response to aDescribeTrainingJobResponse
call. -
Stopping
- The training job is stopping. -
Stopped
- The training job has stopped.
For more detailed information, see SecondaryStatus
.
sourcepub fn set_training_job_status(self, input: Option<TrainingJobStatus>) -> Self
pub fn set_training_job_status(self, input: Option<TrainingJobStatus>) -> Self
The status of the training job.
Training job statuses are:
-
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 theFailureReason
field in the response to aDescribeTrainingJobResponse
call. -
Stopping
- The training job is stopping. -
Stopped
- The training job has stopped.
For more detailed information, see SecondaryStatus
.
sourcepub fn secondary_status(self, input: SecondaryStatus) -> Self
pub fn secondary_status(self, input: SecondaryStatus) -> Self
Provides detailed information about the state of the training job. For detailed information about the secondary status of the training job, see StatusMessage
under SecondaryStatusTransition
.
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 supportFile
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 theFailureReason
field ofDescribeTrainingJobResponse
.
-
- Stopped
-
-
MaxRuntimeExceeded
- The job stopped because it exceeded the maximum allowed runtime. -
Stopped
- The training job has stopped.
-
- Stopping
-
-
Stopping
- Stopping the training job.
-
Valid values for SecondaryStatus
are subject to change.
We no longer support the following secondary statuses:
-
LaunchingMLInstances
-
PreparingTrainingStack
-
DownloadingTrainingImage
sourcepub fn set_secondary_status(self, input: Option<SecondaryStatus>) -> Self
pub fn set_secondary_status(self, input: Option<SecondaryStatus>) -> Self
Provides detailed information about the state of the training job. For detailed information about the secondary status of the training job, see StatusMessage
under SecondaryStatusTransition
.
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 supportFile
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 theFailureReason
field ofDescribeTrainingJobResponse
.
-
- Stopped
-
-
MaxRuntimeExceeded
- The job stopped because it exceeded the maximum allowed runtime. -
Stopped
- The training job has stopped.
-
- Stopping
-
-
Stopping
- Stopping the training job.
-
Valid values for SecondaryStatus
are subject to change.
We no longer support the following secondary statuses:
-
LaunchingMLInstances
-
PreparingTrainingStack
-
DownloadingTrainingImage
sourcepub fn failure_reason(self, input: impl Into<String>) -> Self
pub fn failure_reason(self, input: impl Into<String>) -> Self
If the training job failed, the reason it failed.
sourcepub fn set_failure_reason(self, input: Option<String>) -> Self
pub fn set_failure_reason(self, input: Option<String>) -> Self
If the training job failed, the reason it failed.
sourcepub fn hyper_parameters(self, k: impl Into<String>, v: impl Into<String>) -> Self
pub fn hyper_parameters(self, k: impl Into<String>, v: impl Into<String>) -> Self
Adds a key-value pair to hyper_parameters
.
To override the contents of this collection use set_hyper_parameters
.
Algorithm-specific parameters.
sourcepub fn set_hyper_parameters(self, input: Option<HashMap<String, String>>) -> Self
pub fn set_hyper_parameters(self, input: Option<HashMap<String, String>>) -> Self
Algorithm-specific parameters.
sourcepub fn algorithm_specification(self, input: AlgorithmSpecification) -> Self
pub fn algorithm_specification(self, input: AlgorithmSpecification) -> Self
Information about the algorithm used for training, and algorithm metadata.
sourcepub fn set_algorithm_specification(
self,
input: Option<AlgorithmSpecification>
) -> Self
pub fn set_algorithm_specification(
self,
input: Option<AlgorithmSpecification>
) -> Self
Information about the algorithm used for training, and algorithm metadata.
sourcepub fn role_arn(self, input: impl Into<String>) -> Self
pub fn role_arn(self, input: impl Into<String>) -> Self
The Amazon Web Services Identity and Access Management (IAM) role configured for the training job.
sourcepub fn set_role_arn(self, input: Option<String>) -> Self
pub fn set_role_arn(self, input: Option<String>) -> Self
The Amazon Web Services Identity and Access Management (IAM) role configured for the training job.
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 describes each data input channel.
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 describes each data input channel.
sourcepub fn output_data_config(self, input: OutputDataConfig) -> Self
pub fn output_data_config(self, input: OutputDataConfig) -> Self
The S3 path where model artifacts that you configured when creating the job are stored. SageMaker creates subfolders for model artifacts.
sourcepub fn set_output_data_config(self, input: Option<OutputDataConfig>) -> Self
pub fn set_output_data_config(self, input: Option<OutputDataConfig>) -> Self
The S3 path where model artifacts that you configured when creating the job are stored. SageMaker creates subfolders for model artifacts.
sourcepub fn resource_config(self, input: ResourceConfig) -> Self
pub fn resource_config(self, input: ResourceConfig) -> Self
Resources, including ML compute instances and ML storage volumes, that are configured for model training.
sourcepub fn set_resource_config(self, input: Option<ResourceConfig>) -> Self
pub fn set_resource_config(self, input: Option<ResourceConfig>) -> Self
Resources, including ML compute instances and ML storage volumes, that are configured for model training.
sourcepub fn vpc_config(self, input: VpcConfig) -> Self
pub fn vpc_config(self, input: VpcConfig) -> Self
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.
sourcepub fn set_vpc_config(self, input: Option<VpcConfig>) -> Self
pub fn set_vpc_config(self, input: Option<VpcConfig>) -> Self
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.
sourcepub fn stopping_condition(self, input: StoppingCondition) -> Self
pub fn stopping_condition(self, input: StoppingCondition) -> Self
Specifies a limit to how long a model 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.
To stop a job, SageMaker sends the algorithm the SIGTERM
signal, which delays job termination for 120 seconds. Algorithms can use this 120-second window to save the model artifacts, so the results of training are not lost.
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 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.
To stop a job, SageMaker sends the algorithm the SIGTERM
signal, which delays job termination for 120 seconds. Algorithms can use this 120-second window to save the model artifacts, so the results of training are not lost.
sourcepub fn creation_time(self, input: DateTime) -> Self
pub fn creation_time(self, input: DateTime) -> Self
A timestamp that indicates when the training job was created.
sourcepub fn set_creation_time(self, input: Option<DateTime>) -> Self
pub fn set_creation_time(self, input: Option<DateTime>) -> Self
A timestamp that indicates when the training job was created.
sourcepub fn training_start_time(self, input: DateTime) -> Self
pub fn training_start_time(self, input: DateTime) -> Self
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.
sourcepub fn set_training_start_time(self, input: Option<DateTime>) -> Self
pub fn set_training_start_time(self, input: Option<DateTime>) -> Self
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.
sourcepub fn training_end_time(self, input: DateTime) -> Self
pub fn training_end_time(self, input: DateTime) -> Self
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 SageMaker detects a job failure.
sourcepub fn set_training_end_time(self, input: Option<DateTime>) -> Self
pub fn set_training_end_time(self, input: Option<DateTime>) -> Self
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 SageMaker detects a job failure.
sourcepub fn last_modified_time(self, input: DateTime) -> Self
pub fn last_modified_time(self, input: DateTime) -> Self
A timestamp that indicates when the status of the training job was last modified.
sourcepub fn set_last_modified_time(self, input: Option<DateTime>) -> Self
pub fn set_last_modified_time(self, input: Option<DateTime>) -> Self
A timestamp that indicates when the status of the training job was last modified.
sourcepub fn secondary_status_transitions(
self,
input: SecondaryStatusTransition
) -> Self
pub fn secondary_status_transitions(
self,
input: SecondaryStatusTransition
) -> Self
Appends an item to secondary_status_transitions
.
To override the contents of this collection use set_secondary_status_transitions
.
A history of all of the secondary statuses that the training job has transitioned through.
sourcepub fn set_secondary_status_transitions(
self,
input: Option<Vec<SecondaryStatusTransition>>
) -> Self
pub fn set_secondary_status_transitions(
self,
input: Option<Vec<SecondaryStatusTransition>>
) -> Self
A history of all of the secondary statuses that the training job has transitioned through.
sourcepub fn final_metric_data_list(self, input: MetricData) -> Self
pub fn final_metric_data_list(self, input: MetricData) -> Self
Appends an item to final_metric_data_list
.
To override the contents of this collection use set_final_metric_data_list
.
A list of final metric values that are set when the training job completes. Used only if the training job was configured to use metrics.
sourcepub fn set_final_metric_data_list(self, input: Option<Vec<MetricData>>) -> Self
pub fn set_final_metric_data_list(self, input: Option<Vec<MetricData>>) -> Self
A list of final metric values that are set when the training job completes. Used only if the training job was configured to use metrics.
sourcepub fn enable_network_isolation(self, input: bool) -> Self
pub fn enable_network_isolation(self, input: bool) -> Self
If the TrainingJob
was created with network isolation, the value is set to true
. If network isolation is enabled, nodes can't communicate beyond the VPC they run in.
sourcepub fn set_enable_network_isolation(self, input: Option<bool>) -> Self
pub fn set_enable_network_isolation(self, input: Option<bool>) -> Self
If the TrainingJob
was created with network isolation, the value is set to true
. If network isolation is enabled, nodes can't communicate beyond the VPC they run in.
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
When true, enables managed spot training using Amazon EC2 Spot instances to run training jobs instead of on-demand instances. For more information, see Managed Spot Training.
sourcepub fn set_enable_managed_spot_training(self, input: Option<bool>) -> Self
pub fn set_enable_managed_spot_training(self, input: Option<bool>) -> Self
When true, enables managed spot training using Amazon EC2 Spot instances to run training jobs instead of on-demand instances. For more information, see Managed Spot Training.
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 training_time_in_seconds(self, input: i32) -> Self
pub fn training_time_in_seconds(self, input: i32) -> Self
The training time in seconds.
sourcepub fn set_training_time_in_seconds(self, input: Option<i32>) -> Self
pub fn set_training_time_in_seconds(self, input: Option<i32>) -> Self
The training time in seconds.
sourcepub fn billable_time_in_seconds(self, input: i32) -> Self
pub fn billable_time_in_seconds(self, input: i32) -> Self
The billable time in seconds.
sourcepub fn set_billable_time_in_seconds(self, input: Option<i32>) -> Self
pub fn set_billable_time_in_seconds(self, input: Option<i32>) -> Self
The billable time in seconds.
sourcepub fn debug_hook_config(self, input: DebugHookConfig) -> Self
pub fn debug_hook_config(self, input: DebugHookConfig) -> Self
Configuration information for the Amazon SageMaker Debugger hook parameters, metric and tensor collections, and storage paths. To learn more about how to configure the DebugHookConfig
parameter, see Use the SageMaker and Debugger Configuration API Operations to Create, Update, and Debug Your Training Job.
sourcepub fn set_debug_hook_config(self, input: Option<DebugHookConfig>) -> Self
pub fn set_debug_hook_config(self, input: Option<DebugHookConfig>) -> Self
Configuration information for the Amazon SageMaker Debugger hook parameters, metric and tensor collections, and storage paths. To learn more about how to configure the DebugHookConfig
parameter, see Use the SageMaker and Debugger Configuration API Operations to Create, Update, and Debug Your Training Job.
sourcepub fn experiment_config(self, input: ExperimentConfig) -> Self
pub fn experiment_config(self, input: ExperimentConfig) -> Self
Associates a SageMaker job as a trial component with an experiment and trial. Specified when you call the following APIs:
-
CreateProcessingJob
-
CreateTrainingJob
-
CreateTransformJob
sourcepub fn set_experiment_config(self, input: Option<ExperimentConfig>) -> Self
pub fn set_experiment_config(self, input: Option<ExperimentConfig>) -> Self
Associates a SageMaker job as a trial component with an experiment and trial. Specified when you call the following APIs:
-
CreateProcessingJob
-
CreateTrainingJob
-
CreateTransformJob
sourcepub fn debug_rule_configurations(self, input: DebugRuleConfiguration) -> Self
pub fn debug_rule_configurations(self, input: DebugRuleConfiguration) -> Self
Appends an item to debug_rule_configurations
.
To override the contents of this collection use set_debug_rule_configurations
.
Information about the debug rule configuration.
sourcepub fn set_debug_rule_configurations(
self,
input: Option<Vec<DebugRuleConfiguration>>
) -> Self
pub fn set_debug_rule_configurations(
self,
input: Option<Vec<DebugRuleConfiguration>>
) -> Self
Information about the debug rule configuration.
sourcepub fn tensor_board_output_config(self, input: TensorBoardOutputConfig) -> Self
pub fn tensor_board_output_config(self, input: TensorBoardOutputConfig) -> Self
Configuration of storage locations for the Amazon SageMaker Debugger TensorBoard output data.
sourcepub fn set_tensor_board_output_config(
self,
input: Option<TensorBoardOutputConfig>
) -> Self
pub fn set_tensor_board_output_config(
self,
input: Option<TensorBoardOutputConfig>
) -> Self
Configuration of storage locations for the Amazon SageMaker Debugger TensorBoard output data.
sourcepub fn debug_rule_evaluation_statuses(
self,
input: DebugRuleEvaluationStatus
) -> Self
pub fn debug_rule_evaluation_statuses(
self,
input: DebugRuleEvaluationStatus
) -> Self
Appends an item to debug_rule_evaluation_statuses
.
To override the contents of this collection use set_debug_rule_evaluation_statuses
.
Information about the evaluation status of the rules for the training job.
sourcepub fn set_debug_rule_evaluation_statuses(
self,
input: Option<Vec<DebugRuleEvaluationStatus>>
) -> Self
pub fn set_debug_rule_evaluation_statuses(
self,
input: Option<Vec<DebugRuleEvaluationStatus>>
) -> Self
Information about the evaluation status of the rules for the training job.
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
.
The environment variables to set in the Docker container.
sourcepub fn set_environment(self, input: Option<HashMap<String, String>>) -> Self
pub fn set_environment(self, input: Option<HashMap<String, String>>) -> Self
The environment variables to set in the Docker container.
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
.
Appends an item to tags
.
To override the contents of this collection use set_tags
.
An array of key-value pairs. You can use tags to categorize your Amazon Web Services resources in different ways, for example, by purpose, owner, or environment. For more information, see Tagging Amazon Web Services Resources.
An array of key-value pairs. You can use tags to categorize your Amazon Web Services resources in different ways, for example, by purpose, owner, or environment. For more information, see Tagging Amazon Web Services Resources.
sourcepub fn build(self) -> TrainingJob
pub fn build(self) -> TrainingJob
Consumes the builder and constructs a TrainingJob
.