#[non_exhaustive]pub struct TrainingJobDefinitionBuilder { /* private fields */ }
Expand description
A builder for TrainingJobDefinition
.
Implementations§
Source§impl TrainingJobDefinitionBuilder
impl TrainingJobDefinitionBuilder
Sourcepub fn training_input_mode(self, input: TrainingInputMode) -> Self
pub fn training_input_mode(self, input: TrainingInputMode) -> Self
The training input mode that the algorithm supports. For more information about input modes, see Algorithms.
Pipe mode
If an algorithm supports Pipe
mode, Amazon SageMaker streams data directly from Amazon S3 to the container.
File mode
If an algorithm supports File
mode, SageMaker downloads the training data from S3 to the provisioned ML storage volume, and mounts the directory to the Docker volume for the training container.
You must provision the ML storage volume with sufficient capacity to accommodate the data downloaded from S3. In addition to the training data, the ML storage volume also stores the output model. The algorithm container uses the ML storage volume to also store intermediate information, if any.
For distributed algorithms, training data is distributed uniformly. Your training duration is predictable if the input data objects sizes are approximately the same. 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 when one host in a training cluster is overloaded, thus becoming a bottleneck in training.
FastFile mode
If an algorithm supports FastFile
mode, SageMaker streams data directly from S3 to the container with no code changes, and provides file system access to the data. Users can author their training script to interact with these files as if they were stored on disk.
FastFile
mode works best when the data is read sequentially. Augmented manifest files aren't supported. The startup time is lower when there are fewer files in the S3 bucket provided.
Sourcepub fn set_training_input_mode(self, input: Option<TrainingInputMode>) -> Self
pub fn set_training_input_mode(self, input: Option<TrainingInputMode>) -> Self
The training input mode that the algorithm supports. For more information about input modes, see Algorithms.
Pipe mode
If an algorithm supports Pipe
mode, Amazon SageMaker streams data directly from Amazon S3 to the container.
File mode
If an algorithm supports File
mode, SageMaker downloads the training data from S3 to the provisioned ML storage volume, and mounts the directory to the Docker volume for the training container.
You must provision the ML storage volume with sufficient capacity to accommodate the data downloaded from S3. In addition to the training data, the ML storage volume also stores the output model. The algorithm container uses the ML storage volume to also store intermediate information, if any.
For distributed algorithms, training data is distributed uniformly. Your training duration is predictable if the input data objects sizes are approximately the same. 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 when one host in a training cluster is overloaded, thus becoming a bottleneck in training.
FastFile mode
If an algorithm supports FastFile
mode, SageMaker streams data directly from S3 to the container with no code changes, and provides file system access to the data. Users can author their training script to interact with these files as if they were stored on disk.
FastFile
mode works best when the data is read sequentially. Augmented manifest files aren't supported. The startup time is lower when there are fewer files in the S3 bucket provided.
Sourcepub fn get_training_input_mode(&self) -> &Option<TrainingInputMode>
pub fn get_training_input_mode(&self) -> &Option<TrainingInputMode>
The training input mode that the algorithm supports. For more information about input modes, see Algorithms.
Pipe mode
If an algorithm supports Pipe
mode, Amazon SageMaker streams data directly from Amazon S3 to the container.
File mode
If an algorithm supports File
mode, SageMaker downloads the training data from S3 to the provisioned ML storage volume, and mounts the directory to the Docker volume for the training container.
You must provision the ML storage volume with sufficient capacity to accommodate the data downloaded from S3. In addition to the training data, the ML storage volume also stores the output model. The algorithm container uses the ML storage volume to also store intermediate information, if any.
For distributed algorithms, training data is distributed uniformly. Your training duration is predictable if the input data objects sizes are approximately the same. 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 when one host in a training cluster is overloaded, thus becoming a bottleneck in training.
FastFile mode
If an algorithm supports FastFile
mode, SageMaker streams data directly from S3 to the container with no code changes, and provides file system access to the data. Users can author their training script to interact with these files as if they were stored on disk.
FastFile
mode works best when the data is read sequentially. Augmented manifest files aren't supported. The startup time is lower when there are fewer files in the S3 bucket provided.
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
.
The hyperparameters used for the training job.
Sourcepub fn set_hyper_parameters(
self,
input: Option<HashMap<String, String>>,
) -> Self
pub fn set_hyper_parameters( self, input: Option<HashMap<String, String>>, ) -> Self
The hyperparameters used for the training job.
Sourcepub fn get_hyper_parameters(&self) -> &Option<HashMap<String, String>>
pub fn get_hyper_parameters(&self) -> &Option<HashMap<String, String>>
The hyperparameters used 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, each of which specifies an input source.
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, each of which specifies an input source.
Sourcepub fn get_input_data_config(&self) -> &Option<Vec<Channel>>
pub fn get_input_data_config(&self) -> &Option<Vec<Channel>>
An array of Channel
objects, each of which specifies an input source.
Sourcepub fn output_data_config(self, input: OutputDataConfig) -> Self
pub fn output_data_config(self, input: OutputDataConfig) -> Self
the path to the S3 bucket where you want to store model artifacts. SageMaker creates subfolders for the artifacts.
This field is required.Sourcepub fn set_output_data_config(self, input: Option<OutputDataConfig>) -> Self
pub fn set_output_data_config(self, input: Option<OutputDataConfig>) -> Self
the path to the S3 bucket where you want to store model artifacts. SageMaker creates subfolders for the artifacts.
Sourcepub fn get_output_data_config(&self) -> &Option<OutputDataConfig>
pub fn get_output_data_config(&self) -> &Option<OutputDataConfig>
the path to the S3 bucket where you want to store model artifacts. SageMaker creates subfolders for the artifacts.
Sourcepub fn resource_config(self, input: ResourceConfig) -> Self
pub fn resource_config(self, input: ResourceConfig) -> Self
The resources, including the ML compute instances and ML storage volumes, to use for model training.
This field is required.Sourcepub fn set_resource_config(self, input: Option<ResourceConfig>) -> Self
pub fn set_resource_config(self, input: Option<ResourceConfig>) -> Self
The resources, including the ML compute instances and ML storage volumes, to use for model training.
Sourcepub fn get_resource_config(&self) -> &Option<ResourceConfig>
pub fn get_resource_config(&self) -> &Option<ResourceConfig>
The resources, including the ML compute instances and ML storage volumes, to use for model training.
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.
This field is required.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.
Sourcepub fn get_stopping_condition(&self) -> &Option<StoppingCondition>
pub fn get_stopping_condition(&self) -> &Option<StoppingCondition>
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.
Sourcepub fn build(self) -> TrainingJobDefinition
pub fn build(self) -> TrainingJobDefinition
Consumes the builder and constructs a TrainingJobDefinition
.
Trait Implementations§
Source§impl Clone for TrainingJobDefinitionBuilder
impl Clone for TrainingJobDefinitionBuilder
Source§fn clone(&self) -> TrainingJobDefinitionBuilder
fn clone(&self) -> TrainingJobDefinitionBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for TrainingJobDefinitionBuilder
impl Debug for TrainingJobDefinitionBuilder
Source§impl Default for TrainingJobDefinitionBuilder
impl Default for TrainingJobDefinitionBuilder
Source§fn default() -> TrainingJobDefinitionBuilder
fn default() -> TrainingJobDefinitionBuilder
Source§impl PartialEq for TrainingJobDefinitionBuilder
impl PartialEq for TrainingJobDefinitionBuilder
Source§fn eq(&self, other: &TrainingJobDefinitionBuilder) -> bool
fn eq(&self, other: &TrainingJobDefinitionBuilder) -> bool
self
and other
values to be equal, and is used by ==
.impl StructuralPartialEq for TrainingJobDefinitionBuilder
Auto Trait Implementations§
impl Freeze for TrainingJobDefinitionBuilder
impl RefUnwindSafe for TrainingJobDefinitionBuilder
impl Send for TrainingJobDefinitionBuilder
impl Sync for TrainingJobDefinitionBuilder
impl Unpin for TrainingJobDefinitionBuilder
impl UnwindSafe for TrainingJobDefinitionBuilder
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);