Class: AWSCDK::Sagemaker::CfnModelPackage::TransformInputProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
sagemaker/cfn_model_package.rb

Overview

Describes the input source of a transform job and the way the transform job consumes it.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data_source:, compression_type: nil, content_type: nil, split_type: nil) ⇒ TransformInputProperty

Returns a new instance of TransformInputProperty.

Parameters:

  • data_source (AWSCDK::IResolvable, AWSCDK::Sagemaker::CfnModelPackage::DataSourceProperty)

    Describes the location of the channel data, which is, the S3 location of the input data that the model can consume.

  • compression_type (String, nil) (defaults to: nil)

    If your transform data is compressed, specify the compression type.

  • content_type (String, nil) (defaults to: nil)

    The multipurpose internet mail extension (MIME) type of the data.

  • split_type (String, nil) (defaults to: nil)

    The method to use to split the transform job's data files into smaller batches.



2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
# File 'sagemaker/cfn_model_package.rb', line 2434

def initialize(data_source:, compression_type: nil, content_type: nil, split_type: nil)
  @data_source = data_source.is_a?(Hash) ? ::AWSCDK::Sagemaker::CfnModelPackage::DataSourceProperty.new(**data_source.transform_keys(&:to_sym)) : data_source
  Jsii::Type.check_type(@data_source, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19zYWdlbWFrZXIuQ2ZuTW9kZWxQYWNrYWdlLkRhdGFTb3VyY2VQcm9wZXJ0eSJ9XX19")), "dataSource")
  @compression_type = compression_type
  Jsii::Type.check_type(@compression_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "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?
  @split_type = split_type
  Jsii::Type.check_type(@split_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "splitType") unless @split_type.nil?
end

Instance Attribute Details

#compression_typeString? (readonly)

If your transform data is compressed, specify the compression type.

Amazon SageMaker automatically decompresses the data for the transform job accordingly. The default value is None .



2456
2457
2458
# File 'sagemaker/cfn_model_package.rb', line 2456

def compression_type
  @compression_type
end

#content_typeString? (readonly)

The multipurpose internet mail extension (MIME) type of the data.

Amazon SageMaker uses the MIME type with each http call to transfer data to the transform job.



2463
2464
2465
# File 'sagemaker/cfn_model_package.rb', line 2463

def content_type
  @content_type
end

#data_sourceAWSCDK::IResolvable, AWSCDK::Sagemaker::CfnModelPackage::DataSourceProperty (readonly)

Describes the location of the channel data, which is, the S3 location of the input data that the model can consume.



2449
2450
2451
# File 'sagemaker/cfn_model_package.rb', line 2449

def data_source
  @data_source
end

#split_typeString? (readonly)

The method to use to split the transform job's data files into smaller batches.

Splitting is necessary when the total size of each object is too large to fit in a single request. You can also use data splitting to improve performance by processing multiple concurrent mini-batches. The default value for SplitType is None , which indicates that input data files are not split, and request payloads contain the entire contents of an input object. Set the value of this parameter to Line to split records on a newline character boundary. SplitType also supports a number of record-oriented binary data formats. Currently, the supported record formats are:

  • RecordIO
  • TFRecord

When splitting is enabled, the size of a mini-batch depends on the values of the BatchStrategy and MaxPayloadInMB parameters. When the value of BatchStrategy is MultiRecord , Amazon SageMaker sends the maximum number of records in each request, up to the MaxPayloadInMB limit. If the value of BatchStrategy is SingleRecord , Amazon SageMaker sends individual records in each request.

Some data formats represent a record as a binary payload wrapped with extra padding bytes. When splitting is applied to a binary data format, padding is removed if the value of BatchStrategy is set to SingleRecord . Padding is not removed if the value of BatchStrategy is set to MultiRecord .

For more information about RecordIO , see Create a Dataset Using RecordIO in the MXNet documentation. For more information about TFRecord , see Consuming TFRecord data in the TensorFlow documentation.



2479
2480
2481
# File 'sagemaker/cfn_model_package.rb', line 2479

def split_type
  @split_type
end

Class Method Details

.jsii_propertiesObject



2481
2482
2483
2484
2485
2486
2487
2488
# File 'sagemaker/cfn_model_package.rb', line 2481

def self.jsii_properties
  {
    :data_source => "dataSource",
    :compression_type => "compressionType",
    :content_type => "contentType",
    :split_type => "splitType",
  }
end

Instance Method Details

#to_jsiiObject



2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
# File 'sagemaker/cfn_model_package.rb', line 2490

def to_jsii
  result = {}
  result.merge!({
    "dataSource" => @data_source,
    "compressionType" => @compression_type,
    "contentType" => @content_type,
    "splitType" => @split_type,
  })
  result.compact
end