Class: AWSCDK::StepFunctionsTasks::AlgorithmSpecification
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::StepFunctionsTasks::AlgorithmSpecification
- Defined in:
- step_functions_tasks/algorithm_specification.rb
Overview
Specify the training algorithm and algorithm-specific metadata.
Instance Attribute Summary collapse
-
#algorithm_name ⇒ String?
readonly
Name of the algorithm resource to use for the training job.
-
#metric_definitions ⇒ Array<AWSCDK::StepFunctionsTasks::MetricDefinition>?
readonly
List of metric definition objects.
-
#training_image ⇒ AWSCDK::StepFunctionsTasks::DockerImage?
readonly
Registry path of the Docker image that contains the training algorithm.
-
#training_input_mode ⇒ AWSCDK::StepFunctionsTasks::InputMode?
readonly
Input mode that the algorithm supports.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(algorithm_name: nil, metric_definitions: nil, training_image: nil, training_input_mode: nil) ⇒ AlgorithmSpecification
constructor
A new instance of AlgorithmSpecification.
- #to_jsii ⇒ Object
Constructor Details
#initialize(algorithm_name: nil, metric_definitions: nil, training_image: nil, training_input_mode: nil) ⇒ AlgorithmSpecification
Returns a new instance of AlgorithmSpecification.
11 12 13 14 15 16 17 18 19 20 |
# File 'step_functions_tasks/algorithm_specification.rb', line 11 def initialize(algorithm_name: nil, metric_definitions: nil, training_image: nil, training_input_mode: nil) @algorithm_name = algorithm_name Jsii::Type.check_type(@algorithm_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "algorithmName") unless @algorithm_name.nil? @metric_definitions = metric_definitions.is_a?(Array) ? metric_definitions.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::StepFunctionsTasks::MetricDefinition.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : metric_definitions Jsii::Type.check_type(@metric_definitions, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19zdGVwZnVuY3Rpb25zX3Rhc2tzLk1ldHJpY0RlZmluaXRpb24ifSwia2luZCI6ImFycmF5In19")), "metricDefinitions") unless @metric_definitions.nil? @training_image = training_image Jsii::Type.check_type(@training_image, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc3RlcGZ1bmN0aW9uc190YXNrcy5Eb2NrZXJJbWFnZSJ9")), "trainingImage") unless @training_image.nil? @training_input_mode = training_input_mode Jsii::Type.check_type(@training_input_mode, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc3RlcGZ1bmN0aW9uc190YXNrcy5JbnB1dE1vZGUifQ==")), "trainingInputMode") unless @training_input_mode.nil? end |
Instance Attribute Details
#algorithm_name ⇒ String? (readonly)
Default: - No algorithm is specified
Name of the algorithm resource to use for the training job.
This must be an algorithm resource that you created or subscribe to on AWS Marketplace. If you specify a value for this parameter, you can't specify a value for TrainingImage.
29 30 31 |
# File 'step_functions_tasks/algorithm_specification.rb', line 29 def algorithm_name @algorithm_name end |
#metric_definitions ⇒ Array<AWSCDK::StepFunctionsTasks::MetricDefinition>? (readonly)
Default: - No metrics
List of metric definition objects.
Each object specifies the metric name and regular expressions used to parse algorithm logs.
36 37 38 |
# File 'step_functions_tasks/algorithm_specification.rb', line 36 def metric_definitions @metric_definitions end |
#training_image ⇒ AWSCDK::StepFunctionsTasks::DockerImage? (readonly)
Default: - No Docker image is specified
Registry path of the Docker image that contains the training algorithm.
41 42 43 |
# File 'step_functions_tasks/algorithm_specification.rb', line 41 def training_image @training_image end |
#training_input_mode ⇒ AWSCDK::StepFunctionsTasks::InputMode? (readonly)
Default: 'File' mode
Input mode that the algorithm supports.
46 47 48 |
# File 'step_functions_tasks/algorithm_specification.rb', line 46 def training_input_mode @training_input_mode end |
Class Method Details
.jsii_properties ⇒ Object
48 49 50 51 52 53 54 55 |
# File 'step_functions_tasks/algorithm_specification.rb', line 48 def self.jsii_properties { :algorithm_name => "algorithmName", :metric_definitions => "metricDefinitions", :training_image => "trainingImage", :training_input_mode => "trainingInputMode", } end |
Instance Method Details
#to_jsii ⇒ Object
57 58 59 60 61 62 63 64 65 66 |
# File 'step_functions_tasks/algorithm_specification.rb', line 57 def to_jsii result = {} result.merge!({ "algorithmName" => @algorithm_name, "metricDefinitions" => @metric_definitions, "trainingImage" => @training_image, "trainingInputMode" => @training_input_mode, }) result.compact end |