#[non_exhaustive]pub struct AlgorithmSpecification {
pub training_image: Option<String>,
pub algorithm_name: Option<String>,
pub training_input_mode: Option<TrainingInputMode>,
pub metric_definitions: Option<Vec<MetricDefinition>>,
pub enable_sage_maker_metrics_time_series: Option<bool>,
pub container_entrypoint: Option<Vec<String>>,
pub container_arguments: Option<Vec<String>>,
pub training_image_config: Option<TrainingImageConfig>,
}
Expand description
Specifies the training algorithm to use in a CreateTrainingJob request.
SageMaker uses its own SageMaker account credentials to pull and access built-in algorithms so built-in algorithms are universally accessible across all Amazon Web Services accounts. As a result, built-in algorithms have standard, unrestricted access. You cannot restrict built-in algorithms using IAM roles. Use custom algorithms if you require specific access controls.
For more information about algorithms provided by SageMaker, see Algorithms. For information about using your own algorithms, see Using Your Own Algorithms with Amazon SageMaker.
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.training_image: Option<String>
The registry path of the Docker image that contains the training algorithm. For information about docker registry paths for SageMaker built-in algorithms, see Docker Registry Paths and Example Code in the Amazon SageMaker developer guide. SageMaker supports both registry/repository\[:tag\]
and registry/repository\[@digest\]
image path formats. For more information about using your custom training container, see Using Your Own Algorithms with Amazon SageMaker.
You must specify either the algorithm name to the AlgorithmName
parameter or the image URI of the algorithm container to the TrainingImage
parameter.
For more information, see the note in the AlgorithmName
parameter description.
algorithm_name: Option<String>
The name of the algorithm resource to use for the training job. This must be an algorithm resource that you created or subscribe to on Amazon Web Services Marketplace.
You must specify either the algorithm name to the AlgorithmName
parameter or the image URI of the algorithm container to the TrainingImage
parameter.
Note that the AlgorithmName
parameter is mutually exclusive with the TrainingImage
parameter. If you specify a value for the AlgorithmName
parameter, you can't specify a value for TrainingImage
, and vice versa.
If you specify values for both parameters, the training job might break; if you don't specify any value for both parameters, the training job might raise a null
error.
training_input_mode: 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.
metric_definitions: Option<Vec<MetricDefinition>>
A list of metric definition objects. Each object specifies the metric name and regular expressions used to parse algorithm logs. SageMaker publishes each metric to Amazon CloudWatch.
enable_sage_maker_metrics_time_series: Option<bool>
To generate and save time-series metrics during training, set to true
. The default is false
and time-series metrics aren't generated except in the following cases:
-
You use one of the SageMaker built-in algorithms
-
You use one of the following Prebuilt SageMaker Docker Images:
-
Tensorflow (version >= 1.15)
-
MXNet (version >= 1.6)
-
PyTorch (version >= 1.3)
-
-
You specify at least one MetricDefinition
container_entrypoint: Option<Vec<String>>
The entrypoint script for a Docker container used to run a training job. This script takes precedence over the default train processing instructions. See How Amazon SageMaker Runs Your Training Image for more information.
container_arguments: Option<Vec<String>>
The arguments for a container used to run a training job. See How Amazon SageMaker Runs Your Training Image for additional information.
training_image_config: Option<TrainingImageConfig>
The configuration to use an image from a private Docker registry for a training job.
Implementations§
Source§impl AlgorithmSpecification
impl AlgorithmSpecification
Sourcepub fn training_image(&self) -> Option<&str>
pub fn training_image(&self) -> Option<&str>
The registry path of the Docker image that contains the training algorithm. For information about docker registry paths for SageMaker built-in algorithms, see Docker Registry Paths and Example Code in the Amazon SageMaker developer guide. SageMaker supports both registry/repository\[:tag\]
and registry/repository\[@digest\]
image path formats. For more information about using your custom training container, see Using Your Own Algorithms with Amazon SageMaker.
You must specify either the algorithm name to the AlgorithmName
parameter or the image URI of the algorithm container to the TrainingImage
parameter.
For more information, see the note in the AlgorithmName
parameter description.
Sourcepub fn algorithm_name(&self) -> Option<&str>
pub fn algorithm_name(&self) -> Option<&str>
The name of the algorithm resource to use for the training job. This must be an algorithm resource that you created or subscribe to on Amazon Web Services Marketplace.
You must specify either the algorithm name to the AlgorithmName
parameter or the image URI of the algorithm container to the TrainingImage
parameter.
Note that the AlgorithmName
parameter is mutually exclusive with the TrainingImage
parameter. If you specify a value for the AlgorithmName
parameter, you can't specify a value for TrainingImage
, and vice versa.
If you specify values for both parameters, the training job might break; if you don't specify any value for both parameters, the training job might raise a null
error.
Sourcepub fn training_input_mode(&self) -> Option<&TrainingInputMode>
pub fn 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 metric_definitions(&self) -> &[MetricDefinition]
pub fn metric_definitions(&self) -> &[MetricDefinition]
A list of metric definition objects. Each object specifies the metric name and regular expressions used to parse algorithm logs. SageMaker publishes each metric to Amazon CloudWatch.
If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use .metric_definitions.is_none()
.
Sourcepub fn enable_sage_maker_metrics_time_series(&self) -> Option<bool>
pub fn enable_sage_maker_metrics_time_series(&self) -> Option<bool>
To generate and save time-series metrics during training, set to true
. The default is false
and time-series metrics aren't generated except in the following cases:
-
You use one of the SageMaker built-in algorithms
-
You use one of the following Prebuilt SageMaker Docker Images:
-
Tensorflow (version >= 1.15)
-
MXNet (version >= 1.6)
-
PyTorch (version >= 1.3)
-
-
You specify at least one MetricDefinition
Sourcepub fn container_entrypoint(&self) -> &[String]
pub fn container_entrypoint(&self) -> &[String]
The entrypoint script for a Docker container used to run a training job. This script takes precedence over the default train processing instructions. See How Amazon SageMaker Runs Your Training Image for more information.
If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use .container_entrypoint.is_none()
.
Sourcepub fn container_arguments(&self) -> &[String]
pub fn container_arguments(&self) -> &[String]
The arguments for a container used to run a training job. See How Amazon SageMaker Runs Your Training Image for additional information.
If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use .container_arguments.is_none()
.
Sourcepub fn training_image_config(&self) -> Option<&TrainingImageConfig>
pub fn training_image_config(&self) -> Option<&TrainingImageConfig>
The configuration to use an image from a private Docker registry for a training job.
Source§impl AlgorithmSpecification
impl AlgorithmSpecification
Sourcepub fn builder() -> AlgorithmSpecificationBuilder
pub fn builder() -> AlgorithmSpecificationBuilder
Creates a new builder-style object to manufacture AlgorithmSpecification
.
Trait Implementations§
Source§impl Clone for AlgorithmSpecification
impl Clone for AlgorithmSpecification
Source§fn clone(&self) -> AlgorithmSpecification
fn clone(&self) -> AlgorithmSpecification
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for AlgorithmSpecification
impl Debug for AlgorithmSpecification
Source§impl PartialEq for AlgorithmSpecification
impl PartialEq for AlgorithmSpecification
impl StructuralPartialEq for AlgorithmSpecification
Auto Trait Implementations§
impl Freeze for AlgorithmSpecification
impl RefUnwindSafe for AlgorithmSpecification
impl Send for AlgorithmSpecification
impl Sync for AlgorithmSpecification
impl Unpin for AlgorithmSpecification
impl UnwindSafe for AlgorithmSpecification
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);