Class: AWSCDK::StepFunctionsTasks::AlgorithmSpecification

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
step_functions_tasks/algorithm_specification.rb

Overview

Specify the training algorithm and algorithm-specific metadata.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(algorithm_name: nil, metric_definitions: nil, training_image: nil, training_input_mode: nil) ⇒ AlgorithmSpecification

Returns a new instance of AlgorithmSpecification.

Parameters:



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_nameString? (readonly)

Note:

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.

Returns:

  • (String, nil)


29
30
31
# File 'step_functions_tasks/algorithm_specification.rb', line 29

def algorithm_name
  @algorithm_name
end

#metric_definitionsArray<AWSCDK::StepFunctionsTasks::MetricDefinition>? (readonly)

Note:

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_imageAWSCDK::StepFunctionsTasks::DockerImage? (readonly)

Note:

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_modeAWSCDK::StepFunctionsTasks::InputMode? (readonly)

Note:

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_propertiesObject



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_jsiiObject



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