flytekitplugins.awssagemaker.AlgorithmSpecification#

class flytekitplugins.awssagemaker.AlgorithmSpecification(algorithm_name=0, algorithm_version='', input_mode=0, metric_definitions=None, input_content_type=0)[source]#

Specifies the training algorithm to be used in the training job This object is mostly a pass-through, with a couple of exceptions include: (1) in Flyte, users don’t need to specify TrainingImage; either use the built-in algorithm mode by using Flytekit’s Simple Training Job and specifying an algorithm name and an algorithm version or (2) when users want to supply custom algorithms they should set algorithm_name field to CUSTOM. In this case, the value of the algorithm_version field has no effect For pass-through use cases: refer to this AWS official document for more details https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_AlgorithmSpecification.html

Methods

Parameters
  • algorithm_name (int) –

  • algorithm_version (str) –

  • input_mode (int) –

  • metric_definitions (List[flytekitplugins.awssagemaker.models.training_job.MetricDefinition]) –

  • input_content_type (int) –

classmethod from_flyte_idl(pb2_object)[source]#
Parameters

pb2_object (flyteidl.plugins.sagemaker.training_job_pb2.AlgorithmSpecification) –

short_string()#
Return type

Text

to_flyte_idl()[source]#
Return type

flyteidl.plugins.sagemaker.training_job_pb2.AlgorithmSpecification

verbose_string()#
Return type

Text

Attributes

algorithm_name#

The algorithm name is used for deciding which pre-built image to point to. enum value from AlgorithmName. :rtype: int

algorithm_version#

version of the algorithm (if using built-in algorithm mode). :rtype: str

input_content_type#

enum value from InputContentType. The content type of the input data See https://docs.aws.amazon.com/sagemaker/latest/dg/cdf-training.html https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-algo-docker-registry-paths.html :rtype: int

input_mode#

enum value from InputMode. The input mode can be either PIPE or FILE :rtype: int

is_empty#
metric_definitions#

A list of metric definitions for SageMaker to evaluate/track on the progress of the training job See this: https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_AlgorithmSpecification.html

Note that, when you use one of the Amazon SageMaker built-in algorithms, you cannot define custom metrics. If you are doing hyperparameter tuning, built-in algorithms automatically send metrics to hyperparameter tuning. When using hyperparameter tuning, you do need to choose one of the metrics that the built-in algorithm emits as the objective metric for the tuning job. See this: https://docs.aws.amazon.com/sagemaker/latest/dg/automatic-model-tuning-define-metrics.html :rtype: List[MetricDefinition]