Class SageMakerCreateTrainingJobProps
Properties for creating an Amazon SageMaker training job.
Inheritance
Namespace: Amazon.CDK.AWS.StepFunctions.Tasks
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class SageMakerCreateTrainingJobProps : Object, ISageMakerCreateTrainingJobProps, ITaskStateBaseProps
Syntax (vb)
Public Class SageMakerCreateTrainingJobProps
Inherits Object
Implements ISageMakerCreateTrainingJobProps, ITaskStateBaseProps
Remarks
ExampleMetadata: infused
Examples
new SageMakerCreateTrainingJob(this, "TrainSagemaker", new SageMakerCreateTrainingJobProps {
TrainingJobName = JsonPath.StringAt("$.JobName"),
AlgorithmSpecification = new AlgorithmSpecification {
AlgorithmName = "BlazingText",
TrainingInputMode = InputMode.FILE
},
InputDataConfig = new [] { new Channel {
ChannelName = "train",
DataSource = new DataSource {
S3DataSource = new S3DataSource {
S3DataType = S3DataType.S3_PREFIX,
S3Location = S3Location.FromJsonExpression("$.S3Bucket")
}
}
} },
OutputDataConfig = new OutputDataConfig {
S3OutputLocation = S3Location.FromBucket(Bucket.FromBucketName(this, "Bucket", "mybucket"), "myoutputpath")
},
ResourceConfig = new ResourceConfig {
InstanceCount = 1,
InstanceType = new InstanceType(JsonPath.StringAt("$.InstanceType")),
VolumeSize = Size.Gibibytes(50)
}, // optional: default is 1 instance of EC2 `M4.XLarge` with `10GB` volume
StoppingCondition = new StoppingCondition {
MaxRuntime = Duration.Hours(2)
}
});
Synopsis
Constructors
SageMakerCreateTrainingJobProps() |
Properties
AlgorithmSpecification | Identifies the training algorithm to use. |
Comment | An optional description for this state. |
Credentials | Credentials for an IAM Role that the State Machine assumes for executing the task. |
EnableNetworkIsolation | Isolates the training container. |
Environment | Environment variables to set in the Docker container. |
Heartbeat | (deprecated) Timeout for the heartbeat. |
HeartbeatTimeout | Timeout for the heartbeat. |
Hyperparameters | Algorithm-specific parameters that influence the quality of the model. |
InputDataConfig | Describes the various datasets (e.g. train, validation, test) and the Amazon S3 location where stored. |
InputPath | JSONPath expression to select part of the state to be the input to this state. |
IntegrationPattern | AWS Step Functions integrates with services directly in the Amazon States Language. |
OutputDataConfig | Identifies the Amazon S3 location where you want Amazon SageMaker to save the results of model training. |
OutputPath | JSONPath expression to select select a portion of the state output to pass to the next state. |
ResourceConfig | Specifies the resources, ML compute instances, and ML storage volumes to deploy for model training. |
ResultPath | JSONPath expression to indicate where to inject the state's output. |
ResultSelector | The JSON that will replace the state's raw result and become the effective result before ResultPath is applied. |
Role | Role for the Training Job. |
StateName | Optional name for this state. |
StoppingCondition | Sets a time limit for training. |
Tags | Tags to be applied to the train job. |
TaskTimeout | Timeout for the task. |
Timeout | (deprecated) Timeout for the task. |
TrainingJobName | Training Job Name. |
VpcConfig | Specifies the VPC that you want your training job to connect to. |
Constructors
SageMakerCreateTrainingJobProps()
public SageMakerCreateTrainingJobProps()
Properties
AlgorithmSpecification
Identifies the training algorithm to use.
public IAlgorithmSpecification AlgorithmSpecification { get; set; }
Property Value
Comment
An optional description for this state.
public string Comment { get; set; }
Property Value
System.String
Remarks
Default: - No comment
Credentials
Credentials for an IAM Role that the State Machine assumes for executing the task.
public ICredentials Credentials { get; set; }
Property Value
Remarks
This enables cross-account resource invocations.
Default: - None (Task is executed using the State Machine's execution role)
See: https://docs.aws.amazon.com/step-functions/latest/dg/concepts-access-cross-acct-resources.html
EnableNetworkIsolation
Isolates the training container.
public Nullable<bool> EnableNetworkIsolation { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
No inbound or outbound network calls can be made to or from the training container.
Default: false
Environment
Environment variables to set in the Docker container.
public IDictionary<string, string> Environment { get; set; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.String>
Remarks
Default: - No environment variables
Heartbeat
(deprecated) Timeout for the heartbeat.
public Duration Heartbeat { get; set; }
Property Value
Remarks
Default: - None
Stability: Deprecated
HeartbeatTimeout
Timeout for the heartbeat.
public Timeout HeartbeatTimeout { get; set; }
Property Value
Remarks
[disable-awslint:duration-prop-type] is needed because all props interface in aws-stepfunctions-tasks extend this interface
Default: - None
Hyperparameters
Algorithm-specific parameters that influence the quality of the model.
public IDictionary<string, object> Hyperparameters { get; set; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.Object>
Remarks
Set hyperparameters before you start the learning process. For a list of hyperparameters provided by Amazon SageMaker
Default: - No hyperparameters
See: https://docs.aws.amazon.com/sagemaker/latest/dg/algos.html
InputDataConfig
Describes the various datasets (e.g. train, validation, test) and the Amazon S3 location where stored.
public IChannel[] InputDataConfig { get; set; }
Property Value
IChannel[]
InputPath
JSONPath expression to select part of the state to be the input to this state.
public string InputPath { get; set; }
Property Value
System.String
Remarks
May also be the special value JsonPath.DISCARD, which will cause the effective input to be the empty object {}.
Default: - The entire task input (JSON path '$')
IntegrationPattern
AWS Step Functions integrates with services directly in the Amazon States Language.
public Nullable<IntegrationPattern> IntegrationPattern { get; set; }
Property Value
System.Nullable<IntegrationPattern>
Remarks
You can control these AWS services using service integration patterns.
Depending on the AWS Service, the Service Integration Pattern availability will vary.
Default: - IntegrationPattern.REQUEST_RESPONSE
for most tasks.
IntegrationPattern.RUN_JOB
for the following exceptions:
BatchSubmitJob
, EmrAddStep
, EmrCreateCluster
, EmrTerminationCluster
, and EmrContainersStartJobRun
.
See: https://docs.aws.amazon.com/step-functions/latest/dg/connect-supported-services.html
OutputDataConfig
Identifies the Amazon S3 location where you want Amazon SageMaker to save the results of model training.
public IOutputDataConfig OutputDataConfig { get; set; }
Property Value
OutputPath
JSONPath expression to select select a portion of the state output to pass to the next state.
public string OutputPath { get; set; }
Property Value
System.String
Remarks
May also be the special value JsonPath.DISCARD, which will cause the effective output to be the empty object {}.
Default: - The entire JSON node determined by the state input, the task result, and resultPath is passed to the next state (JSON path '$')
ResourceConfig
Specifies the resources, ML compute instances, and ML storage volumes to deploy for model training.
public IResourceConfig ResourceConfig { get; set; }
Property Value
Remarks
Default: - 1 instance of EC2 M4.XLarge
with 10GB
volume
ResultPath
JSONPath expression to indicate where to inject the state's output.
public string ResultPath { get; set; }
Property Value
System.String
Remarks
May also be the special value JsonPath.DISCARD, which will cause the state's input to become its output.
Default: - Replaces the entire input with the result (JSON path '$')
ResultSelector
The JSON that will replace the state's raw result and become the effective result before ResultPath is applied.
public IDictionary<string, object> ResultSelector { get; set; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.Object>
Remarks
You can use ResultSelector to create a payload with values that are static or selected from the state's raw result.
Default: - None
Role
Role for the Training Job.
public IRole Role { get; set; }
Property Value
Remarks
The role must be granted all necessary permissions for the SageMaker training job to be able to operate.
Default: - a role will be created.
StateName
Optional name for this state.
public string StateName { get; set; }
Property Value
System.String
Remarks
Default: - The construct ID will be used as state name
StoppingCondition
Sets a time limit for training.
public IStoppingCondition StoppingCondition { get; set; }
Property Value
Remarks
Default: - max runtime of 1 hour
Tags
Tags to be applied to the train job.
public IDictionary<string, string> Tags { get; set; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.String>
Remarks
Default: - No tags
TaskTimeout
Timeout for the task.
public Timeout TaskTimeout { get; set; }
Property Value
Remarks
[disable-awslint:duration-prop-type] is needed because all props interface in aws-stepfunctions-tasks extend this interface
Default: - None
Timeout
(deprecated) Timeout for the task.
public Duration Timeout { get; set; }
Property Value
Remarks
Default: - None
Stability: Deprecated
TrainingJobName
Training Job Name.
public string TrainingJobName { get; set; }
Property Value
System.String
VpcConfig
Specifies the VPC that you want your training job to connect to.
public IVpcConfig VpcConfig { get; set; }
Property Value
Remarks
Default: - No VPC