/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include #include #include #include #include #include #include #include #include namespace Aws { namespace Utils { namespace Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace SageMaker { namespace Model { /** *

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

See Also:

AWS * API Reference

*/ class TrainingJobDefinition { public: AWS_SAGEMAKER_API TrainingJobDefinition(); AWS_SAGEMAKER_API TrainingJobDefinition(Aws::Utils::Json::JsonView jsonValue); AWS_SAGEMAKER_API TrainingJobDefinition& operator=(Aws::Utils::Json::JsonView jsonValue); AWS_SAGEMAKER_API Aws::Utils::Json::JsonValue Jsonize() const; inline const TrainingInputMode& GetTrainingInputMode() const{ return m_trainingInputMode; } inline bool TrainingInputModeHasBeenSet() const { return m_trainingInputModeHasBeenSet; } inline void SetTrainingInputMode(const TrainingInputMode& value) { m_trainingInputModeHasBeenSet = true; m_trainingInputMode = value; } inline void SetTrainingInputMode(TrainingInputMode&& value) { m_trainingInputModeHasBeenSet = true; m_trainingInputMode = std::move(value); } inline TrainingJobDefinition& WithTrainingInputMode(const TrainingInputMode& value) { SetTrainingInputMode(value); return *this;} inline TrainingJobDefinition& WithTrainingInputMode(TrainingInputMode&& value) { SetTrainingInputMode(std::move(value)); return *this;} /** *

The hyperparameters used for the training job.

*/ inline const Aws::Map& GetHyperParameters() const{ return m_hyperParameters; } /** *

The hyperparameters used for the training job.

*/ inline bool HyperParametersHasBeenSet() const { return m_hyperParametersHasBeenSet; } /** *

The hyperparameters used for the training job.

*/ inline void SetHyperParameters(const Aws::Map& value) { m_hyperParametersHasBeenSet = true; m_hyperParameters = value; } /** *

The hyperparameters used for the training job.

*/ inline void SetHyperParameters(Aws::Map&& value) { m_hyperParametersHasBeenSet = true; m_hyperParameters = std::move(value); } /** *

The hyperparameters used for the training job.

*/ inline TrainingJobDefinition& WithHyperParameters(const Aws::Map& value) { SetHyperParameters(value); return *this;} /** *

The hyperparameters used for the training job.

*/ inline TrainingJobDefinition& WithHyperParameters(Aws::Map&& value) { SetHyperParameters(std::move(value)); return *this;} /** *

The hyperparameters used for the training job.

*/ inline TrainingJobDefinition& AddHyperParameters(const Aws::String& key, const Aws::String& value) { m_hyperParametersHasBeenSet = true; m_hyperParameters.emplace(key, value); return *this; } /** *

The hyperparameters used for the training job.

*/ inline TrainingJobDefinition& AddHyperParameters(Aws::String&& key, const Aws::String& value) { m_hyperParametersHasBeenSet = true; m_hyperParameters.emplace(std::move(key), value); return *this; } /** *

The hyperparameters used for the training job.

*/ inline TrainingJobDefinition& AddHyperParameters(const Aws::String& key, Aws::String&& value) { m_hyperParametersHasBeenSet = true; m_hyperParameters.emplace(key, std::move(value)); return *this; } /** *

The hyperparameters used for the training job.

*/ inline TrainingJobDefinition& AddHyperParameters(Aws::String&& key, Aws::String&& value) { m_hyperParametersHasBeenSet = true; m_hyperParameters.emplace(std::move(key), std::move(value)); return *this; } /** *

The hyperparameters used for the training job.

*/ inline TrainingJobDefinition& AddHyperParameters(const char* key, Aws::String&& value) { m_hyperParametersHasBeenSet = true; m_hyperParameters.emplace(key, std::move(value)); return *this; } /** *

The hyperparameters used for the training job.

*/ inline TrainingJobDefinition& AddHyperParameters(Aws::String&& key, const char* value) { m_hyperParametersHasBeenSet = true; m_hyperParameters.emplace(std::move(key), value); return *this; } /** *

The hyperparameters used for the training job.

*/ inline TrainingJobDefinition& AddHyperParameters(const char* key, const char* value) { m_hyperParametersHasBeenSet = true; m_hyperParameters.emplace(key, value); return *this; } /** *

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

*/ inline const Aws::Vector& GetInputDataConfig() const{ return m_inputDataConfig; } /** *

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

*/ inline bool InputDataConfigHasBeenSet() const { return m_inputDataConfigHasBeenSet; } /** *

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

*/ inline void SetInputDataConfig(const Aws::Vector& value) { m_inputDataConfigHasBeenSet = true; m_inputDataConfig = value; } /** *

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

*/ inline void SetInputDataConfig(Aws::Vector&& value) { m_inputDataConfigHasBeenSet = true; m_inputDataConfig = std::move(value); } /** *

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

*/ inline TrainingJobDefinition& WithInputDataConfig(const Aws::Vector& value) { SetInputDataConfig(value); return *this;} /** *

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

*/ inline TrainingJobDefinition& WithInputDataConfig(Aws::Vector&& value) { SetInputDataConfig(std::move(value)); return *this;} /** *

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

*/ inline TrainingJobDefinition& AddInputDataConfig(const Channel& value) { m_inputDataConfigHasBeenSet = true; m_inputDataConfig.push_back(value); return *this; } /** *

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

*/ inline TrainingJobDefinition& AddInputDataConfig(Channel&& value) { m_inputDataConfigHasBeenSet = true; m_inputDataConfig.push_back(std::move(value)); return *this; } /** *

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

*/ inline const OutputDataConfig& GetOutputDataConfig() const{ return m_outputDataConfig; } /** *

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

*/ inline bool OutputDataConfigHasBeenSet() const { return m_outputDataConfigHasBeenSet; } /** *

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

*/ inline void SetOutputDataConfig(const OutputDataConfig& value) { m_outputDataConfigHasBeenSet = true; m_outputDataConfig = value; } /** *

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

*/ inline void SetOutputDataConfig(OutputDataConfig&& value) { m_outputDataConfigHasBeenSet = true; m_outputDataConfig = std::move(value); } /** *

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

*/ inline TrainingJobDefinition& WithOutputDataConfig(const OutputDataConfig& value) { SetOutputDataConfig(value); return *this;} /** *

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

*/ inline TrainingJobDefinition& WithOutputDataConfig(OutputDataConfig&& value) { SetOutputDataConfig(std::move(value)); return *this;} /** *

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

*/ inline const ResourceConfig& GetResourceConfig() const{ return m_resourceConfig; } /** *

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

*/ inline bool ResourceConfigHasBeenSet() const { return m_resourceConfigHasBeenSet; } /** *

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

*/ inline void SetResourceConfig(const ResourceConfig& value) { m_resourceConfigHasBeenSet = true; m_resourceConfig = value; } /** *

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

*/ inline void SetResourceConfig(ResourceConfig&& value) { m_resourceConfigHasBeenSet = true; m_resourceConfig = std::move(value); } /** *

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

*/ inline TrainingJobDefinition& WithResourceConfig(const ResourceConfig& value) { SetResourceConfig(value); return *this;} /** *

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

*/ inline TrainingJobDefinition& WithResourceConfig(ResourceConfig&& value) { SetResourceConfig(std::move(value)); return *this;} /** *

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, SageMaker ends the training job. Use this API to cap model training * costs.

To stop a job, 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.

*/ inline const StoppingCondition& GetStoppingCondition() const{ return m_stoppingCondition; } /** *

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, SageMaker ends the training job. Use this API to cap model training * costs.

To stop a job, 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.

*/ inline bool StoppingConditionHasBeenSet() const { return m_stoppingConditionHasBeenSet; } /** *

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, SageMaker ends the training job. Use this API to cap model training * costs.

To stop a job, 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.

*/ inline void SetStoppingCondition(const StoppingCondition& value) { m_stoppingConditionHasBeenSet = true; m_stoppingCondition = value; } /** *

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, SageMaker ends the training job. Use this API to cap model training * costs.

To stop a job, 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.

*/ inline void SetStoppingCondition(StoppingCondition&& value) { m_stoppingConditionHasBeenSet = true; m_stoppingCondition = std::move(value); } /** *

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, SageMaker ends the training job. Use this API to cap model training * costs.

To stop a job, 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.

*/ inline TrainingJobDefinition& WithStoppingCondition(const StoppingCondition& value) { SetStoppingCondition(value); return *this;} /** *

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, SageMaker ends the training job. Use this API to cap model training * costs.

To stop a job, 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.

*/ inline TrainingJobDefinition& WithStoppingCondition(StoppingCondition&& value) { SetStoppingCondition(std::move(value)); return *this;} private: TrainingInputMode m_trainingInputMode; bool m_trainingInputModeHasBeenSet = false; Aws::Map m_hyperParameters; bool m_hyperParametersHasBeenSet = false; Aws::Vector m_inputDataConfig; bool m_inputDataConfigHasBeenSet = false; OutputDataConfig m_outputDataConfig; bool m_outputDataConfigHasBeenSet = false; ResourceConfig m_resourceConfig; bool m_resourceConfigHasBeenSet = false; StoppingCondition m_stoppingCondition; bool m_stoppingConditionHasBeenSet = false; }; } // namespace Model } // namespace SageMaker } // namespace Aws