Class: AWSCDK::StepFunctionsTasks::Channel

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

Overview

Describes the training, validation or test dataset and the Amazon S3 location where it is stored.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(channel_name:, data_source:, compression_type: nil, content_type: nil, input_mode: nil, record_wrapper_type: nil, shuffle_config: nil) ⇒ Channel

Returns a new instance of Channel.

Parameters:



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'step_functions_tasks/channel.rb', line 14

def initialize(channel_name:, data_source:, compression_type: nil, content_type: nil, input_mode: nil, record_wrapper_type: nil, shuffle_config: nil)
  @channel_name = channel_name
  Jsii::Type.check_type(@channel_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "channelName")
  @data_source = data_source.is_a?(Hash) ? ::AWSCDK::StepFunctionsTasks::DataSource.new(**data_source.transform_keys(&:to_sym)) : data_source
  Jsii::Type.check_type(@data_source, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc3RlcGZ1bmN0aW9uc190YXNrcy5EYXRhU291cmNlIn0=")), "dataSource")
  @compression_type = compression_type
  Jsii::Type.check_type(@compression_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc3RlcGZ1bmN0aW9uc190YXNrcy5Db21wcmVzc2lvblR5cGUifQ==")), "compressionType") unless @compression_type.nil?
  @content_type = content_type
  Jsii::Type.check_type(@content_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "contentType") unless @content_type.nil?
  @input_mode = input_mode
  Jsii::Type.check_type(@input_mode, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc3RlcGZ1bmN0aW9uc190YXNrcy5JbnB1dE1vZGUifQ==")), "inputMode") unless @input_mode.nil?
  @record_wrapper_type = record_wrapper_type
  Jsii::Type.check_type(@record_wrapper_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc3RlcGZ1bmN0aW9uc190YXNrcy5SZWNvcmRXcmFwcGVyVHlwZSJ9")), "recordWrapperType") unless @record_wrapper_type.nil?
  @shuffle_config = shuffle_config.is_a?(Hash) ? ::AWSCDK::StepFunctionsTasks::ShuffleConfig.new(**shuffle_config.transform_keys(&:to_sym)) : shuffle_config
  Jsii::Type.check_type(@shuffle_config, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc3RlcGZ1bmN0aW9uc190YXNrcy5TaHVmZmxlQ29uZmlnIn0=")), "shuffleConfig") unless @shuffle_config.nil?
end

Instance Attribute Details

#channel_nameString (readonly)

Name of the channel.

Returns:

  • (String)


34
35
36
# File 'step_functions_tasks/channel.rb', line 34

def channel_name
  @channel_name
end

#compression_typeAWSCDK::StepFunctionsTasks::CompressionType? (readonly)

Note:

Default: - None

Compression type if training data is compressed.



43
44
45
# File 'step_functions_tasks/channel.rb', line 43

def compression_type
  @compression_type
end

#content_typeString? (readonly)

Note:

Default: - None

The MIME type of the data.

Returns:

  • (String, nil)


48
49
50
# File 'step_functions_tasks/channel.rb', line 48

def content_type
  @content_type
end

#data_sourceAWSCDK::StepFunctionsTasks::DataSource (readonly)

Location of the channel data.



38
39
40
# File 'step_functions_tasks/channel.rb', line 38

def data_source
  @data_source
end

#input_modeAWSCDK::StepFunctionsTasks::InputMode? (readonly)

Note:

Default: - None

Input mode to use for the data channel in a training job.



53
54
55
# File 'step_functions_tasks/channel.rb', line 53

def input_mode
  @input_mode
end

#record_wrapper_typeAWSCDK::StepFunctionsTasks::RecordWrapperType? (readonly)

Note:

Default: - None

Specify RecordIO as the value when input data is in raw format but the training algorithm requires the RecordIO format.

In this case, Amazon SageMaker wraps each individual S3 object in a RecordIO record. If the input data is already in RecordIO format, you don't need to set this attribute.



61
62
63
# File 'step_functions_tasks/channel.rb', line 61

def record_wrapper_type
  @record_wrapper_type
end

#shuffle_configAWSCDK::StepFunctionsTasks::ShuffleConfig? (readonly)

Note:

Default: - None

Shuffle config option for input data in a channel.



66
67
68
# File 'step_functions_tasks/channel.rb', line 66

def shuffle_config
  @shuffle_config
end

Class Method Details

.jsii_propertiesObject



68
69
70
71
72
73
74
75
76
77
78
# File 'step_functions_tasks/channel.rb', line 68

def self.jsii_properties
  {
    :channel_name => "channelName",
    :data_source => "dataSource",
    :compression_type => "compressionType",
    :content_type => "contentType",
    :input_mode => "inputMode",
    :record_wrapper_type => "recordWrapperType",
    :shuffle_config => "shuffleConfig",
  }
end

Instance Method Details

#to_jsiiObject



80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'step_functions_tasks/channel.rb', line 80

def to_jsii
  result = {}
  result.merge!({
    "channelName" => @channel_name,
    "dataSource" => @data_source,
    "compressionType" => @compression_type,
    "contentType" => @content_type,
    "inputMode" => @input_mode,
    "recordWrapperType" => @record_wrapper_type,
    "shuffleConfig" => @shuffle_config,
  })
  result.compact
end