#[non_exhaustive]pub struct HyperParameterTrainingJobDefinition {Show 18 fields
pub definition_name: Option<String>,
pub tuning_objective: Option<HyperParameterTuningJobObjective>,
pub hyper_parameter_ranges: Option<ParameterRanges>,
pub static_hyper_parameters: Option<HashMap<String, String>>,
pub algorithm_specification: Option<HyperParameterAlgorithmSpecification>,
pub role_arn: Option<String>,
pub input_data_config: Option<Vec<Channel>>,
pub vpc_config: Option<VpcConfig>,
pub output_data_config: Option<OutputDataConfig>,
pub resource_config: Option<ResourceConfig>,
pub hyper_parameter_tuning_resource_config: Option<HyperParameterTuningResourceConfig>,
pub stopping_condition: Option<StoppingCondition>,
pub enable_network_isolation: Option<bool>,
pub enable_inter_container_traffic_encryption: Option<bool>,
pub enable_managed_spot_training: Option<bool>,
pub checkpoint_config: Option<CheckpointConfig>,
pub retry_strategy: Option<RetryStrategy>,
pub environment: Option<HashMap<String, String>>,
}
Expand description
Defines the training jobs launched by a hyperparameter tuning job.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.definition_name: Option<String>
The job definition name.
tuning_objective: Option<HyperParameterTuningJobObjective>
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. If you want to define a custom objective metric, see Define metrics and environment variables.
hyper_parameter_ranges: Option<ParameterRanges>
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.
static_hyper_parameters: Option<HashMap<String, String>>
Specifies the values of hyperparameters that do not change for the tuning job.
algorithm_specification: Option<HyperParameterAlgorithmSpecification>
The HyperParameterAlgorithmSpecification object that specifies the resource algorithm to use for the training jobs that the tuning job launches.
role_arn: Option<String>
The Amazon Resource Name (ARN) of the IAM role associated with the training jobs that the tuning job launches.
input_data_config: Option<Vec<Channel>>
An array of Channel objects that specify the input for the training jobs that the tuning job launches.
vpc_config: Option<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.
output_data_config: Option<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: Option<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.
hyper_parameter_tuning_resource_config: Option<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).
stopping_condition: Option<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.
enable_network_isolation: Option<bool>
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.
enable_inter_container_traffic_encryption: Option<bool>
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: Option<bool>
A Boolean indicating whether managed spot training is enabled (True
) or not (False
).
checkpoint_config: Option<CheckpointConfig>
Contains information about the output location for managed spot training checkpoint data.
retry_strategy: Option<RetryStrategy>
The number of times to retry the job when the job fails due to an InternalServerError
.
environment: Option<HashMap<String, String>>
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.
Implementations§
Source§impl HyperParameterTrainingJobDefinition
impl HyperParameterTrainingJobDefinition
Sourcepub fn definition_name(&self) -> Option<&str>
pub fn definition_name(&self) -> Option<&str>
The job definition name.
Sourcepub fn tuning_objective(&self) -> Option<&HyperParameterTuningJobObjective>
pub fn tuning_objective(&self) -> Option<&HyperParameterTuningJobObjective>
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. If you want to define a custom objective metric, see Define metrics and environment variables.
Sourcepub fn hyper_parameter_ranges(&self) -> Option<&ParameterRanges>
pub fn hyper_parameter_ranges(&self) -> Option<&ParameterRanges>
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) -> Option<&HashMap<String, String>>
pub fn static_hyper_parameters(&self) -> Option<&HashMap<String, String>>
Specifies the values of hyperparameters that do not change for the tuning job.
Sourcepub fn algorithm_specification(
&self,
) -> Option<&HyperParameterAlgorithmSpecification>
pub fn algorithm_specification( &self, ) -> Option<&HyperParameterAlgorithmSpecification>
The HyperParameterAlgorithmSpecification object that specifies the resource algorithm to use for the training jobs that the tuning job launches.
Sourcepub fn role_arn(&self) -> Option<&str>
pub fn role_arn(&self) -> Option<&str>
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) -> &[Channel]
pub fn input_data_config(&self) -> &[Channel]
An array of Channel objects that specify the input for the training jobs that the tuning job launches.
If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use .input_data_config.is_none()
.
Sourcepub fn vpc_config(&self) -> Option<&VpcConfig>
pub fn vpc_config(&self) -> Option<&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.
Sourcepub fn output_data_config(&self) -> Option<&OutputDataConfig>
pub fn output_data_config(&self) -> Option<&OutputDataConfig>
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) -> Option<&ResourceConfig>
pub fn resource_config(&self) -> Option<&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.
Sourcepub fn hyper_parameter_tuning_resource_config(
&self,
) -> Option<&HyperParameterTuningResourceConfig>
pub fn hyper_parameter_tuning_resource_config( &self, ) -> Option<&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).
Sourcepub fn stopping_condition(&self) -> Option<&StoppingCondition>
pub fn stopping_condition(&self) -> Option<&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.
Sourcepub fn enable_network_isolation(&self) -> Option<bool>
pub fn enable_network_isolation(&self) -> Option<bool>
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) -> Option<bool>
pub fn enable_inter_container_traffic_encryption(&self) -> Option<bool>
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) -> Option<bool>
pub fn enable_managed_spot_training(&self) -> Option<bool>
A Boolean indicating whether managed spot training is enabled (True
) or not (False
).
Sourcepub fn checkpoint_config(&self) -> Option<&CheckpointConfig>
pub fn checkpoint_config(&self) -> Option<&CheckpointConfig>
Contains information about the output location for managed spot training checkpoint data.
Sourcepub fn retry_strategy(&self) -> Option<&RetryStrategy>
pub fn retry_strategy(&self) -> Option<&RetryStrategy>
The number of times to retry the job when the job fails due to an InternalServerError
.
Sourcepub fn environment(&self) -> Option<&HashMap<String, String>>
pub fn environment(&self) -> Option<&HashMap<String, String>>
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.
Source§impl HyperParameterTrainingJobDefinition
impl HyperParameterTrainingJobDefinition
Sourcepub fn builder() -> HyperParameterTrainingJobDefinitionBuilder
pub fn builder() -> HyperParameterTrainingJobDefinitionBuilder
Creates a new builder-style object to manufacture HyperParameterTrainingJobDefinition
.
Trait Implementations§
Source§impl Clone for HyperParameterTrainingJobDefinition
impl Clone for HyperParameterTrainingJobDefinition
Source§fn clone(&self) -> HyperParameterTrainingJobDefinition
fn clone(&self) -> HyperParameterTrainingJobDefinition
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl PartialEq for HyperParameterTrainingJobDefinition
impl PartialEq for HyperParameterTrainingJobDefinition
Source§fn eq(&self, other: &HyperParameterTrainingJobDefinition) -> bool
fn eq(&self, other: &HyperParameterTrainingJobDefinition) -> bool
self
and other
values to be equal, and is used by ==
.impl StructuralPartialEq for HyperParameterTrainingJobDefinition
Auto Trait Implementations§
impl Freeze for HyperParameterTrainingJobDefinition
impl RefUnwindSafe for HyperParameterTrainingJobDefinition
impl Send for HyperParameterTrainingJobDefinition
impl Sync for HyperParameterTrainingJobDefinition
impl Unpin for HyperParameterTrainingJobDefinition
impl UnwindSafe for HyperParameterTrainingJobDefinition
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the foreground set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red()
and
green()
, which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg()
:
use yansi::{Paint, Color};
painted.fg(Color::White);
Set foreground color to white using white()
.
use yansi::Paint;
painted.white();
Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the background set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red()
and
on_green()
, which have the same functionality but
are pithier.
§Example
Set background color to red using fg()
:
use yansi::{Paint, Color};
painted.bg(Color::Red);
Set background color to red using on_red()
.
use yansi::Paint;
painted.on_red();
Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute
value
.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold()
and
underline()
, which have the same functionality
but are pithier.
§Example
Make text bold using attr()
:
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);
Make text bold using using bold()
.
use yansi::Paint;
painted.bold();
Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi
Quirk
value
.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask()
and
wrap()
, which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk()
:
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);
Enable wrapping using wrap()
.
use yansi::Paint;
painted.wrap();
Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.
fn clear(&self) -> Painted<&T>
resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition
value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted
only when both stdout
and stderr
are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);