TrainingJobDefinition - Amazon SageMaker


Defines the input needed to run a training job using the algorithm.



The hyperparameters used for the training job.

Type: String to string map

Map Entries: Minimum number of 0 items. Maximum number of 100 items.

Key Length Constraints: Maximum length of 256.

Key Pattern: .*

Value Length Constraints: Maximum length of 2500.

Value Pattern: .*

Required: No


An array of Channel objects, each of which specifies an input source.

Type: Array of Channel objects

Array Members: Minimum number of 1 item. Maximum number of 20 items.

Required: Yes


the path to the S3 bucket where you want to store model artifacts. Amazon SageMaker creates subfolders for the artifacts.

Type: OutputDataConfig object

Required: Yes


The resources, including the ML compute instances and ML storage volumes, to use for model training.

Type: ResourceConfig object

Required: Yes


Specifies a limit to how long a model training job can run. It also specifies how long a managed Spot training job has to complete. When the job reaches the time limit, Amazon SageMaker ends the training job. Use this API to cap model training costs.

To stop a job, Amazon SageMaker sends the algorithm the SIGTERM signal, which delays job termination for 120 seconds. Algorithms can use this 120-second window to save the model artifacts.

Type: StoppingCondition object

Required: Yes


The input mode used by the algorithm for the training job. For the input modes that Amazon SageMaker algorithms support, see Algorithms.

If an algorithm supports the File input mode, Amazon SageMaker downloads the training data from S3 to the provisioned ML storage Volume, and mounts the directory to docker volume for training container. If an algorithm supports the Pipe input mode, Amazon SageMaker streams data directly from S3 to the container.

Type: String

Valid Values: Pipe | File

Required: Yes

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: