aws-cdk-lib.aws_stepfunctions_tasks.AlgorithmSpecification

interface AlgorithmSpecification

LanguageType name
.NETAmazon.CDK.AWS.StepFunctions.Tasks.AlgorithmSpecification
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsstepfunctionstasks#AlgorithmSpecification
Javasoftware.amazon.awscdk.services.stepfunctions.tasks.AlgorithmSpecification
Pythonaws_cdk.aws_stepfunctions_tasks.AlgorithmSpecification
TypeScript (source)aws-cdk-lib » aws_stepfunctions_tasks » AlgorithmSpecification

Specify the training algorithm and algorithm-specific metadata.

Example

new tasks.SageMakerCreateTrainingJob(this, 'TrainSagemaker', {
  trainingJobName: sfn.JsonPath.stringAt('$.JobName'),
  algorithmSpecification: {
    algorithmName: 'BlazingText',
    trainingInputMode: tasks.InputMode.FILE,
  },
  inputDataConfig: [{
    channelName: 'train',
    dataSource: {
      s3DataSource: {
        s3DataType: tasks.S3DataType.S3_PREFIX,
        s3Location: tasks.S3Location.fromJsonExpression('$.S3Bucket'),
      },
    },
  }],
  outputDataConfig: {
    s3OutputLocation: tasks.S3Location.fromBucket(s3.Bucket.fromBucketName(this, 'Bucket', 'mybucket'), 'myoutputpath'),
  },
  resourceConfig: {
    instanceCount: 1,
    instanceType: new ec2.InstanceType(sfn.JsonPath.stringAt('$.InstanceType')),
    volumeSize: Size.gibibytes(50),
  }, // optional: default is 1 instance of EC2 `M4.XLarge` with `10GB` volume
  stoppingCondition: {
    maxRuntime: Duration.hours(2),
  }, // optional: default is 1 hour
});

Properties

NameTypeDescription
algorithmName?stringName of the algorithm resource to use for the training job.
metricDefinitions?MetricDefinition[]List of metric definition objects.
trainingImage?DockerImageRegistry path of the Docker image that contains the training algorithm.
trainingInputMode?InputModeInput mode that the algorithm supports.

algorithmName?

Type: string (optional, 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.


metricDefinitions?

Type: MetricDefinition[] (optional, default: No metrics)

List of metric definition objects.

Each object specifies the metric name and regular expressions used to parse algorithm logs.


trainingImage?

Type: DockerImage (optional, default: No Docker image is specified)

Registry path of the Docker image that contains the training algorithm.


trainingInputMode?

Type: InputMode (optional, default: 'File' mode)

Input mode that the algorithm supports.