SagemakerTrainTask

class aws_cdk.aws_stepfunctions_tasks.SagemakerTrainTask(*, algorithm_specification, input_data_config, output_data_config, training_job_name, hyperparameters=None, integration_pattern=None, resource_config=None, role=None, stopping_condition=None, tags=None, vpc_config=None)

Bases: object

Class representing the SageMaker Create Training Job task.

stability :stability: experimental

__init__(*, algorithm_specification, input_data_config, output_data_config, training_job_name, hyperparameters=None, integration_pattern=None, resource_config=None, role=None, stopping_condition=None, tags=None, vpc_config=None)
Parameters
  • algorithm_specification (AlgorithmSpecification) – Identifies the training algorithm to use.

  • input_data_config (List[Channel]) – Describes the various datasets (e.g. train, validation, test) and the Amazon S3 location where stored.

  • output_data_config (OutputDataConfig) – Identifies the Amazon S3 location where you want Amazon SageMaker to save the results of model training.

  • training_job_name (str) – Training Job Name.

  • hyperparameters (Optional[Mapping[str, Any]]) – Algorithm-specific parameters that influence the quality of the model. Set hyperparameters before you start the learning process. For a list of hyperparameters provided by Amazon SageMaker Default: - No hyperparameters

  • integration_pattern (Optional[ServiceIntegrationPattern]) – The service integration pattern indicates different ways to call SageMaker APIs. The valid value is either FIRE_AND_FORGET or SYNC. Default: FIRE_AND_FORGET

  • resource_config (Optional[ResourceConfig]) – Specifies the resources, ML compute instances, and ML storage volumes to deploy for model training. Default: - 1 instance of EC2 M4.XLarge with 10GB volume

  • role (Optional[IRole]) – Role for the Training Job. The role must be granted all necessary permissions for the SageMaker training job to be able to operate. See https://docs.aws.amazon.com/fr_fr/sagemaker/latest/dg/sagemaker-roles.html#sagemaker-roles-createtrainingjob-perms Default: - a role with appropriate permissions will be created.

  • stopping_condition (Optional[StoppingCondition]) – Sets a time limit for training. Default: - max runtime of 1 hour

  • tags (Optional[Mapping[str, str]]) – Tags to be applied to the train job. Default: - No tags

  • vpc_config (Optional[VpcConfig]) – Specifies the VPC that you want your training job to connect to. Default: - No VPC

stability :stability: experimental

Return type

None

Methods

add_security_group(security_group)

Add the security group to all instances via the launch configuration security groups array.

Parameters

security_group (ISecurityGroup) – : The security group to add.

stability :stability: experimental

Return type

None

bind(task)

Called when the task object is used in a workflow.

Parameters

task (Task) –

stability :stability: experimental

Return type

StepFunctionsTaskConfig

Attributes

connections

Allows specify security group connections for instances of this fleet.

stability :stability: experimental

Return type

Connections

grant_principal

The principal to grant permissions to.

stability :stability: experimental

Return type

IPrincipal

role

The execution role for the Sagemaker training job.

Only available after task has been added to a state machine.

stability :stability: experimental

Return type

IRole