All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.sagemaker.model.CreateTrainingJobRequest Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amazon SageMaker module holds the client classes that are used for communicating with Amazon SageMaker Service

There is a newer version: 2.28.4
Show newest version
/*
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
 * the License. A copy of the License is located at
 * 
 * http://aws.amazon.com/apache2.0
 * 
 * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
 * and limitations under the License.
 */

package software.amazon.awssdk.services.sagemaker.model;

import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 */
@Generated("software.amazon.awssdk:codegen")
public final class CreateTrainingJobRequest extends SageMakerRequest implements
        ToCopyableBuilder {
    private static final SdkField TRAINING_JOB_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("TrainingJobName").getter(getter(CreateTrainingJobRequest::trainingJobName))
            .setter(setter(Builder::trainingJobName))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TrainingJobName").build()).build();

    private static final SdkField> HYPER_PARAMETERS_FIELD = SdkField
            .> builder(MarshallingType.MAP)
            .memberName("HyperParameters")
            .getter(getter(CreateTrainingJobRequest::hyperParameters))
            .setter(setter(Builder::hyperParameters))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("HyperParameters").build(),
                    MapTrait.builder()
                            .keyLocationName("key")
                            .valueLocationName("value")
                            .valueFieldInfo(
                                    SdkField. builder(MarshallingType.STRING)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("value").build()).build()).build()).build();

    private static final SdkField ALGORITHM_SPECIFICATION_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("AlgorithmSpecification")
            .getter(getter(CreateTrainingJobRequest::algorithmSpecification)).setter(setter(Builder::algorithmSpecification))
            .constructor(AlgorithmSpecification::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AlgorithmSpecification").build())
            .build();

    private static final SdkField ROLE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("RoleArn").getter(getter(CreateTrainingJobRequest::roleArn)).setter(setter(Builder::roleArn))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RoleArn").build()).build();

    private static final SdkField> INPUT_DATA_CONFIG_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("InputDataConfig")
            .getter(getter(CreateTrainingJobRequest::inputDataConfig))
            .setter(setter(Builder::inputDataConfig))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("InputDataConfig").build(),
                    ListTrait
                            .builder()
                            .memberLocationName(null)
                            .memberFieldInfo(
                                    SdkField. builder(MarshallingType.SDK_POJO)
                                            .constructor(Channel::builder)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("member").build()).build()).build()).build();

    private static final SdkField OUTPUT_DATA_CONFIG_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("OutputDataConfig")
            .getter(getter(CreateTrainingJobRequest::outputDataConfig)).setter(setter(Builder::outputDataConfig))
            .constructor(OutputDataConfig::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OutputDataConfig").build()).build();

    private static final SdkField RESOURCE_CONFIG_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("ResourceConfig")
            .getter(getter(CreateTrainingJobRequest::resourceConfig)).setter(setter(Builder::resourceConfig))
            .constructor(ResourceConfig::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ResourceConfig").build()).build();

    private static final SdkField VPC_CONFIG_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
            .memberName("VpcConfig").getter(getter(CreateTrainingJobRequest::vpcConfig)).setter(setter(Builder::vpcConfig))
            .constructor(VpcConfig::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("VpcConfig").build()).build();

    private static final SdkField STOPPING_CONDITION_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("StoppingCondition")
            .getter(getter(CreateTrainingJobRequest::stoppingCondition)).setter(setter(Builder::stoppingCondition))
            .constructor(StoppingCondition::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StoppingCondition").build()).build();

    private static final SdkField> TAGS_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("Tags")
            .getter(getter(CreateTrainingJobRequest::tags))
            .setter(setter(Builder::tags))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Tags").build(),
                    ListTrait
                            .builder()
                            .memberLocationName(null)
                            .memberFieldInfo(
                                    SdkField. builder(MarshallingType.SDK_POJO)
                                            .constructor(Tag::builder)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("member").build()).build()).build()).build();

    private static final SdkField ENABLE_NETWORK_ISOLATION_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
            .memberName("EnableNetworkIsolation").getter(getter(CreateTrainingJobRequest::enableNetworkIsolation))
            .setter(setter(Builder::enableNetworkIsolation))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EnableNetworkIsolation").build())
            .build();

    private static final SdkField ENABLE_INTER_CONTAINER_TRAFFIC_ENCRYPTION_FIELD = SdkField
            . builder(MarshallingType.BOOLEAN)
            .memberName("EnableInterContainerTrafficEncryption")
            .getter(getter(CreateTrainingJobRequest::enableInterContainerTrafficEncryption))
            .setter(setter(Builder::enableInterContainerTrafficEncryption))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                    .locationName("EnableInterContainerTrafficEncryption").build()).build();

    private static final SdkField ENABLE_MANAGED_SPOT_TRAINING_FIELD = SdkField
            . builder(MarshallingType.BOOLEAN).memberName("EnableManagedSpotTraining")
            .getter(getter(CreateTrainingJobRequest::enableManagedSpotTraining))
            .setter(setter(Builder::enableManagedSpotTraining))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EnableManagedSpotTraining").build())
            .build();

    private static final SdkField CHECKPOINT_CONFIG_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("CheckpointConfig")
            .getter(getter(CreateTrainingJobRequest::checkpointConfig)).setter(setter(Builder::checkpointConfig))
            .constructor(CheckpointConfig::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CheckpointConfig").build()).build();

    private static final SdkField DEBUG_HOOK_CONFIG_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("DebugHookConfig")
            .getter(getter(CreateTrainingJobRequest::debugHookConfig)).setter(setter(Builder::debugHookConfig))
            .constructor(DebugHookConfig::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DebugHookConfig").build()).build();

    private static final SdkField> DEBUG_RULE_CONFIGURATIONS_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("DebugRuleConfigurations")
            .getter(getter(CreateTrainingJobRequest::debugRuleConfigurations))
            .setter(setter(Builder::debugRuleConfigurations))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DebugRuleConfigurations").build(),
                    ListTrait
                            .builder()
                            .memberLocationName(null)
                            .memberFieldInfo(
                                    SdkField. builder(MarshallingType.SDK_POJO)
                                            .constructor(DebugRuleConfiguration::builder)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("member").build()).build()).build()).build();

    private static final SdkField TENSOR_BOARD_OUTPUT_CONFIG_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("TensorBoardOutputConfig")
            .getter(getter(CreateTrainingJobRequest::tensorBoardOutputConfig)).setter(setter(Builder::tensorBoardOutputConfig))
            .constructor(TensorBoardOutputConfig::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TensorBoardOutputConfig").build())
            .build();

    private static final SdkField EXPERIMENT_CONFIG_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("ExperimentConfig")
            .getter(getter(CreateTrainingJobRequest::experimentConfig)).setter(setter(Builder::experimentConfig))
            .constructor(ExperimentConfig::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ExperimentConfig").build()).build();

    private static final SdkField PROFILER_CONFIG_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("ProfilerConfig")
            .getter(getter(CreateTrainingJobRequest::profilerConfig)).setter(setter(Builder::profilerConfig))
            .constructor(ProfilerConfig::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ProfilerConfig").build()).build();

    private static final SdkField> PROFILER_RULE_CONFIGURATIONS_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("ProfilerRuleConfigurations")
            .getter(getter(CreateTrainingJobRequest::profilerRuleConfigurations))
            .setter(setter(Builder::profilerRuleConfigurations))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ProfilerRuleConfigurations").build(),
                    ListTrait
                            .builder()
                            .memberLocationName(null)
                            .memberFieldInfo(
                                    SdkField. builder(MarshallingType.SDK_POJO)
                                            .constructor(ProfilerRuleConfiguration::builder)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("member").build()).build()).build()).build();

    private static final SdkField> ENVIRONMENT_FIELD = SdkField
            .> builder(MarshallingType.MAP)
            .memberName("Environment")
            .getter(getter(CreateTrainingJobRequest::environment))
            .setter(setter(Builder::environment))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Environment").build(),
                    MapTrait.builder()
                            .keyLocationName("key")
                            .valueLocationName("value")
                            .valueFieldInfo(
                                    SdkField. builder(MarshallingType.STRING)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("value").build()).build()).build()).build();

    private static final SdkField RETRY_STRATEGY_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("RetryStrategy")
            .getter(getter(CreateTrainingJobRequest::retryStrategy)).setter(setter(Builder::retryStrategy))
            .constructor(RetryStrategy::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RetryStrategy").build()).build();

    private static final SdkField REMOTE_DEBUG_CONFIG_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("RemoteDebugConfig")
            .getter(getter(CreateTrainingJobRequest::remoteDebugConfig)).setter(setter(Builder::remoteDebugConfig))
            .constructor(RemoteDebugConfig::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RemoteDebugConfig").build()).build();

    private static final SdkField INFRA_CHECK_CONFIG_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("InfraCheckConfig")
            .getter(getter(CreateTrainingJobRequest::infraCheckConfig)).setter(setter(Builder::infraCheckConfig))
            .constructor(InfraCheckConfig::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("InfraCheckConfig").build()).build();

    private static final SdkField SESSION_CHAINING_CONFIG_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("SessionChainingConfig")
            .getter(getter(CreateTrainingJobRequest::sessionChainingConfig)).setter(setter(Builder::sessionChainingConfig))
            .constructor(SessionChainingConfig::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SessionChainingConfig").build())
            .build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(TRAINING_JOB_NAME_FIELD,
            HYPER_PARAMETERS_FIELD, ALGORITHM_SPECIFICATION_FIELD, ROLE_ARN_FIELD, INPUT_DATA_CONFIG_FIELD,
            OUTPUT_DATA_CONFIG_FIELD, RESOURCE_CONFIG_FIELD, VPC_CONFIG_FIELD, STOPPING_CONDITION_FIELD, TAGS_FIELD,
            ENABLE_NETWORK_ISOLATION_FIELD, ENABLE_INTER_CONTAINER_TRAFFIC_ENCRYPTION_FIELD, ENABLE_MANAGED_SPOT_TRAINING_FIELD,
            CHECKPOINT_CONFIG_FIELD, DEBUG_HOOK_CONFIG_FIELD, DEBUG_RULE_CONFIGURATIONS_FIELD, TENSOR_BOARD_OUTPUT_CONFIG_FIELD,
            EXPERIMENT_CONFIG_FIELD, PROFILER_CONFIG_FIELD, PROFILER_RULE_CONFIGURATIONS_FIELD, ENVIRONMENT_FIELD,
            RETRY_STRATEGY_FIELD, REMOTE_DEBUG_CONFIG_FIELD, INFRA_CHECK_CONFIG_FIELD, SESSION_CHAINING_CONFIG_FIELD));

    private final String trainingJobName;

    private final Map hyperParameters;

    private final AlgorithmSpecification algorithmSpecification;

    private final String roleArn;

    private final List inputDataConfig;

    private final OutputDataConfig outputDataConfig;

    private final ResourceConfig resourceConfig;

    private final VpcConfig vpcConfig;

    private final StoppingCondition stoppingCondition;

    private final List tags;

    private final Boolean enableNetworkIsolation;

    private final Boolean enableInterContainerTrafficEncryption;

    private final Boolean enableManagedSpotTraining;

    private final CheckpointConfig checkpointConfig;

    private final DebugHookConfig debugHookConfig;

    private final List debugRuleConfigurations;

    private final TensorBoardOutputConfig tensorBoardOutputConfig;

    private final ExperimentConfig experimentConfig;

    private final ProfilerConfig profilerConfig;

    private final List profilerRuleConfigurations;

    private final Map environment;

    private final RetryStrategy retryStrategy;

    private final RemoteDebugConfig remoteDebugConfig;

    private final InfraCheckConfig infraCheckConfig;

    private final SessionChainingConfig sessionChainingConfig;

    private CreateTrainingJobRequest(BuilderImpl builder) {
        super(builder);
        this.trainingJobName = builder.trainingJobName;
        this.hyperParameters = builder.hyperParameters;
        this.algorithmSpecification = builder.algorithmSpecification;
        this.roleArn = builder.roleArn;
        this.inputDataConfig = builder.inputDataConfig;
        this.outputDataConfig = builder.outputDataConfig;
        this.resourceConfig = builder.resourceConfig;
        this.vpcConfig = builder.vpcConfig;
        this.stoppingCondition = builder.stoppingCondition;
        this.tags = builder.tags;
        this.enableNetworkIsolation = builder.enableNetworkIsolation;
        this.enableInterContainerTrafficEncryption = builder.enableInterContainerTrafficEncryption;
        this.enableManagedSpotTraining = builder.enableManagedSpotTraining;
        this.checkpointConfig = builder.checkpointConfig;
        this.debugHookConfig = builder.debugHookConfig;
        this.debugRuleConfigurations = builder.debugRuleConfigurations;
        this.tensorBoardOutputConfig = builder.tensorBoardOutputConfig;
        this.experimentConfig = builder.experimentConfig;
        this.profilerConfig = builder.profilerConfig;
        this.profilerRuleConfigurations = builder.profilerRuleConfigurations;
        this.environment = builder.environment;
        this.retryStrategy = builder.retryStrategy;
        this.remoteDebugConfig = builder.remoteDebugConfig;
        this.infraCheckConfig = builder.infraCheckConfig;
        this.sessionChainingConfig = builder.sessionChainingConfig;
    }

    /**
     * 

* The name of the training job. The name must be unique within an Amazon Web Services Region in an Amazon Web * Services account. *

* * @return The name of the training job. The name must be unique within an Amazon Web Services Region in an Amazon * Web Services account. */ public final String trainingJobName() { return trainingJobName; } /** * For responses, this returns true if the service returned a value for the HyperParameters property. This DOES NOT * check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). * This is useful because the SDK will never return a null collection or map, but you may need to differentiate * between the service returning nothing (or null) and the service returning an empty collection or map. For * requests, this returns true if a value for the property was specified in the request builder, and false if a * value was not specified. */ public final boolean hasHyperParameters() { return hyperParameters != null && !(hyperParameters instanceof SdkAutoConstructMap); } /** *

* Algorithm-specific parameters that influence the quality of the model. You set hyperparameters before you start * the learning process. For a list of hyperparameters for each training algorithm provided by SageMaker, see Algorithms. *

*

* You can specify a maximum of 100 hyperparameters. Each hyperparameter is a key-value pair. Each key and value is * limited to 256 characters, as specified by the Length Constraint. *

* *

* Do not include any security-sensitive information including account access IDs, secrets or tokens in any * hyperparameter field. If the use of security-sensitive credentials are detected, SageMaker will reject your * training job request and return an exception error. *

*
*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasHyperParameters} method. *

* * @return Algorithm-specific parameters that influence the quality of the model. You set hyperparameters before you * start the learning process. For a list of hyperparameters for each training algorithm provided by * SageMaker, see Algorithms.

*

* You can specify a maximum of 100 hyperparameters. Each hyperparameter is a key-value pair. Each key and * value is limited to 256 characters, as specified by the Length Constraint. *

* *

* Do not include any security-sensitive information including account access IDs, secrets or tokens in any * hyperparameter field. If the use of security-sensitive credentials are detected, SageMaker will reject * your training job request and return an exception error. *

*/ public final Map hyperParameters() { return hyperParameters; } /** *

* The registry path of the Docker image that contains the training algorithm and algorithm-specific metadata, * including the input mode. For more information about algorithms provided by SageMaker, see Algorithms. For information about providing * your own algorithms, see Using * Your Own Algorithms with Amazon SageMaker. *

* * @return The registry path of the Docker image that contains the training algorithm and algorithm-specific * metadata, including the input mode. For more information about algorithms provided by SageMaker, see Algorithms. For information about * providing your own algorithms, see Using Your Own Algorithms * with Amazon SageMaker. */ public final AlgorithmSpecification algorithmSpecification() { return algorithmSpecification; } /** *

* The Amazon Resource Name (ARN) of an IAM role that SageMaker can assume to perform tasks on your behalf. *

*

* During model training, SageMaker needs your permission to read input data from an S3 bucket, download a Docker * image that contains training code, write model artifacts to an S3 bucket, write logs to Amazon CloudWatch Logs, * and publish metrics to Amazon CloudWatch. You grant permissions for all of these tasks to an IAM role. For more * information, see SageMaker * Roles. *

* *

* To be able to pass this role to SageMaker, the caller of this API must have the iam:PassRole * permission. *

*
* * @return The Amazon Resource Name (ARN) of an IAM role that SageMaker can assume to perform tasks on your behalf. *

*

* During model training, SageMaker needs your permission to read input data from an S3 bucket, download a * Docker image that contains training code, write model artifacts to an S3 bucket, write logs to Amazon * CloudWatch Logs, and publish metrics to Amazon CloudWatch. You grant permissions for all of these tasks * to an IAM role. For more information, see SageMaker Roles. *

* *

* To be able to pass this role to SageMaker, the caller of this API must have the iam:PassRole * permission. *

*/ public final String roleArn() { return roleArn; } /** * For responses, this returns true if the service returned a value for the InputDataConfig property. This DOES NOT * check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). * This is useful because the SDK will never return a null collection or map, but you may need to differentiate * between the service returning nothing (or null) and the service returning an empty collection or map. For * requests, this returns true if a value for the property was specified in the request builder, and false if a * value was not specified. */ public final boolean hasInputDataConfig() { return inputDataConfig != null && !(inputDataConfig instanceof SdkAutoConstructList); } /** *

* An array of Channel objects. Each channel is a named input source. InputDataConfig * describes the input data and its location. *

*

* Algorithms can accept input data from one or more channels. For example, an algorithm might have two channels of * input data, training_data and validation_data. The configuration for each channel * provides the S3, EFS, or FSx location where the input data is stored. It also provides information about the * stored data: the MIME type, compression method, and whether the data is wrapped in RecordIO format. *

*

* Depending on the input mode that the algorithm supports, SageMaker either copies input data files from an S3 * bucket to a local directory in the Docker container, or makes it available as input streams. For example, if you * specify an EFS location, input data files are available as input streams. They do not need to be downloaded. *

*

* Your input must be in the same Amazon Web Services region as your training job. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasInputDataConfig} method. *

* * @return An array of Channel objects. Each channel is a named input source. * InputDataConfig describes the input data and its location.

*

* Algorithms can accept input data from one or more channels. For example, an algorithm might have two * channels of input data, training_data and validation_data. The configuration * for each channel provides the S3, EFS, or FSx location where the input data is stored. It also provides * information about the stored data: the MIME type, compression method, and whether the data is wrapped in * RecordIO format. *

*

* Depending on the input mode that the algorithm supports, SageMaker either copies input data files from an * S3 bucket to a local directory in the Docker container, or makes it available as input streams. For * example, if you specify an EFS location, input data files are available as input streams. They do not * need to be downloaded. *

*

* Your input must be in the same Amazon Web Services region as your training job. */ public final List inputDataConfig() { return inputDataConfig; } /** *

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

* * @return Specifies the path to the S3 location where you want to store model artifacts. SageMaker creates * subfolders for the artifacts. */ public final OutputDataConfig outputDataConfig() { return outputDataConfig; } /** *

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

*

* ML storage volumes store model artifacts and incremental states. Training algorithms might also use ML storage * volumes for scratch space. If you want SageMaker to use the ML storage volume to store the training data, choose * File as the TrainingInputMode in the algorithm specification. For distributed training * algorithms, specify an instance count greater than 1. *

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

*

* ML storage volumes store model artifacts and incremental states. Training algorithms might also use ML * storage volumes for scratch space. If you want SageMaker to use the ML storage volume to store the * training data, choose File as the TrainingInputMode in the algorithm * specification. For distributed training algorithms, specify an instance count greater than 1. */ public final ResourceConfig resourceConfig() { return resourceConfig; } /** *

* A VpcConfig object * that specifies the VPC that you want your training job to connect to. Control access to and from your training * container by configuring the VPC. For more information, see Protect Training Jobs by Using an Amazon * Virtual Private Cloud. *

* * @return A VpcConfig * object that specifies the VPC that you want your training job to connect to. Control access to and from * your training container by configuring the VPC. For more information, see Protect Training Jobs by Using an * Amazon Virtual Private Cloud. */ public final VpcConfig vpcConfig() { return vpcConfig; } /** *

* 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, so the results of training * are not lost. *

* * @return 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, so * the results of training are not lost. */ public final StoppingCondition stoppingCondition() { return stoppingCondition; } /** * For responses, this returns true if the service returned a value for the Tags property. This DOES NOT check that * the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is useful * because the SDK will never return a null collection or map, but you may need to differentiate between the service * returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true * if a value for the property was specified in the request builder, and false if a value was not specified. */ public final boolean hasTags() { return tags != null && !(tags instanceof SdkAutoConstructList); } /** *

* An array of key-value pairs. You can use tags to categorize your Amazon Web Services resources in different ways, * for example, by purpose, owner, or environment. For more information, see Tagging Amazon Web Services Resources. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasTags} method. *

* * @return An array of key-value pairs. You can use tags to categorize your Amazon Web Services resources in * different ways, for example, by purpose, owner, or environment. For more information, see Tagging Amazon Web Services * Resources. */ public final List tags() { return tags; } /** *

* Isolates the training container. No inbound or outbound network calls can be made, except for calls between peers * within a training cluster for distributed training. If you enable network isolation for training jobs that are * configured to use a VPC, SageMaker downloads and uploads customer data and model artifacts through the specified * VPC, but the training container does not have network access. *

* * @return Isolates the training container. No inbound or outbound network calls can be made, except for calls * between peers within a training cluster for distributed training. If you enable network isolation for * training jobs that are configured to use a VPC, SageMaker downloads and uploads customer data and model * artifacts through the specified VPC, but the training container does not have network access. */ public final Boolean enableNetworkIsolation() { return enableNetworkIsolation; } /** *

* To encrypt all communications between ML compute instances in distributed training, choose True. * Encryption provides greater security for distributed training, but training might take longer. How long it takes * depends on the amount of communication between compute instances, especially if you use a deep learning algorithm * in distributed training. For more information, see Protect Communications Between ML * Compute Instances in a Distributed Training Job. *

* * @return To encrypt all communications between ML compute instances in distributed training, choose * True. Encryption provides greater security for distributed training, but training might take * longer. How long it takes depends on the amount of communication between compute instances, especially if * you use a deep learning algorithm in distributed training. For more information, see Protect Communications Between * ML Compute Instances in a Distributed Training Job. */ public final Boolean enableInterContainerTrafficEncryption() { return enableInterContainerTrafficEncryption; } /** *

* To train models using managed spot training, choose True. Managed spot training provides a fully * managed and scalable infrastructure for training machine learning models. this option is useful when training * jobs can be interrupted and when there is flexibility when the training job is run. *

*

* The complete and intermediate results of jobs are stored in an Amazon S3 bucket, and can be used as a starting * point to train models incrementally. Amazon SageMaker provides metrics and logs in CloudWatch. They can be used * to see when managed spot training jobs are running, interrupted, resumed, or completed. *

* * @return To train models using managed spot training, choose True. Managed spot training provides a * fully managed and scalable infrastructure for training machine learning models. this option is useful * when training jobs can be interrupted and when there is flexibility when the training job is run.

*

* The complete and intermediate results of jobs are stored in an Amazon S3 bucket, and can be used as a * starting point to train models incrementally. Amazon SageMaker provides metrics and logs in CloudWatch. * They can be used to see when managed spot training jobs are running, interrupted, resumed, or completed. */ public final Boolean enableManagedSpotTraining() { return enableManagedSpotTraining; } /** *

* Contains information about the output location for managed spot training checkpoint data. *

* * @return Contains information about the output location for managed spot training checkpoint data. */ public final CheckpointConfig checkpointConfig() { return checkpointConfig; } /** * Returns the value of the DebugHookConfig property for this object. * * @return The value of the DebugHookConfig property for this object. */ public final DebugHookConfig debugHookConfig() { return debugHookConfig; } /** * For responses, this returns true if the service returned a value for the DebugRuleConfigurations property. This * DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the * property). This is useful because the SDK will never return a null collection or map, but you may need to * differentiate between the service returning nothing (or null) and the service returning an empty collection or * map. For requests, this returns true if a value for the property was specified in the request builder, and false * if a value was not specified. */ public final boolean hasDebugRuleConfigurations() { return debugRuleConfigurations != null && !(debugRuleConfigurations instanceof SdkAutoConstructList); } /** *

* Configuration information for Amazon SageMaker Debugger rules for debugging output tensors. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasDebugRuleConfigurations} method. *

* * @return Configuration information for Amazon SageMaker Debugger rules for debugging output tensors. */ public final List debugRuleConfigurations() { return debugRuleConfigurations; } /** * Returns the value of the TensorBoardOutputConfig property for this object. * * @return The value of the TensorBoardOutputConfig property for this object. */ public final TensorBoardOutputConfig tensorBoardOutputConfig() { return tensorBoardOutputConfig; } /** * Returns the value of the ExperimentConfig property for this object. * * @return The value of the ExperimentConfig property for this object. */ public final ExperimentConfig experimentConfig() { return experimentConfig; } /** * Returns the value of the ProfilerConfig property for this object. * * @return The value of the ProfilerConfig property for this object. */ public final ProfilerConfig profilerConfig() { return profilerConfig; } /** * For responses, this returns true if the service returned a value for the ProfilerRuleConfigurations property. * This DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the * property). This is useful because the SDK will never return a null collection or map, but you may need to * differentiate between the service returning nothing (or null) and the service returning an empty collection or * map. For requests, this returns true if a value for the property was specified in the request builder, and false * if a value was not specified. */ public final boolean hasProfilerRuleConfigurations() { return profilerRuleConfigurations != null && !(profilerRuleConfigurations instanceof SdkAutoConstructList); } /** *

* Configuration information for Amazon SageMaker Debugger rules for profiling system and framework metrics. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasProfilerRuleConfigurations} method. *

* * @return Configuration information for Amazon SageMaker Debugger rules for profiling system and framework metrics. */ public final List profilerRuleConfigurations() { return profilerRuleConfigurations; } /** * For responses, this returns true if the service returned a value for the Environment property. This DOES NOT * check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). * This is useful because the SDK will never return a null collection or map, but you may need to differentiate * between the service returning nothing (or null) and the service returning an empty collection or map. For * requests, this returns true if a value for the property was specified in the request builder, and false if a * value was not specified. */ public final boolean hasEnvironment() { return environment != null && !(environment instanceof SdkAutoConstructMap); } /** *

* The environment variables to set in the Docker container. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasEnvironment} method. *

* * @return The environment variables to set in the Docker container. */ public final Map environment() { return environment; } /** *

* The number of times to retry the job when the job fails due to an InternalServerError. *

* * @return The number of times to retry the job when the job fails due to an InternalServerError. */ public final RetryStrategy retryStrategy() { return retryStrategy; } /** *

* Configuration for remote debugging. To learn more about the remote debugging functionality of SageMaker, see Access a training container * through Amazon Web Services Systems Manager (SSM) for remote debugging. *

* * @return Configuration for remote debugging. To learn more about the remote debugging functionality of SageMaker, * see Access a * training container through Amazon Web Services Systems Manager (SSM) for remote debugging. */ public final RemoteDebugConfig remoteDebugConfig() { return remoteDebugConfig; } /** *

* Contains information about the infrastructure health check configuration for the training job. *

* * @return Contains information about the infrastructure health check configuration for the training job. */ public final InfraCheckConfig infraCheckConfig() { return infraCheckConfig; } /** *

* Contains information about attribute-based access control (ABAC) for the training job. *

* * @return Contains information about attribute-based access control (ABAC) for the training job. */ public final SessionChainingConfig sessionChainingConfig() { return sessionChainingConfig; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + super.hashCode(); hashCode = 31 * hashCode + Objects.hashCode(trainingJobName()); hashCode = 31 * hashCode + Objects.hashCode(hasHyperParameters() ? hyperParameters() : null); hashCode = 31 * hashCode + Objects.hashCode(algorithmSpecification()); hashCode = 31 * hashCode + Objects.hashCode(roleArn()); hashCode = 31 * hashCode + Objects.hashCode(hasInputDataConfig() ? inputDataConfig() : null); hashCode = 31 * hashCode + Objects.hashCode(outputDataConfig()); hashCode = 31 * hashCode + Objects.hashCode(resourceConfig()); hashCode = 31 * hashCode + Objects.hashCode(vpcConfig()); hashCode = 31 * hashCode + Objects.hashCode(stoppingCondition()); hashCode = 31 * hashCode + Objects.hashCode(hasTags() ? tags() : null); hashCode = 31 * hashCode + Objects.hashCode(enableNetworkIsolation()); hashCode = 31 * hashCode + Objects.hashCode(enableInterContainerTrafficEncryption()); hashCode = 31 * hashCode + Objects.hashCode(enableManagedSpotTraining()); hashCode = 31 * hashCode + Objects.hashCode(checkpointConfig()); hashCode = 31 * hashCode + Objects.hashCode(debugHookConfig()); hashCode = 31 * hashCode + Objects.hashCode(hasDebugRuleConfigurations() ? debugRuleConfigurations() : null); hashCode = 31 * hashCode + Objects.hashCode(tensorBoardOutputConfig()); hashCode = 31 * hashCode + Objects.hashCode(experimentConfig()); hashCode = 31 * hashCode + Objects.hashCode(profilerConfig()); hashCode = 31 * hashCode + Objects.hashCode(hasProfilerRuleConfigurations() ? profilerRuleConfigurations() : null); hashCode = 31 * hashCode + Objects.hashCode(hasEnvironment() ? environment() : null); hashCode = 31 * hashCode + Objects.hashCode(retryStrategy()); hashCode = 31 * hashCode + Objects.hashCode(remoteDebugConfig()); hashCode = 31 * hashCode + Objects.hashCode(infraCheckConfig()); hashCode = 31 * hashCode + Objects.hashCode(sessionChainingConfig()); return hashCode; } @Override public final boolean equals(Object obj) { return super.equals(obj) && equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof CreateTrainingJobRequest)) { return false; } CreateTrainingJobRequest other = (CreateTrainingJobRequest) obj; return Objects.equals(trainingJobName(), other.trainingJobName()) && hasHyperParameters() == other.hasHyperParameters() && Objects.equals(hyperParameters(), other.hyperParameters()) && Objects.equals(algorithmSpecification(), other.algorithmSpecification()) && Objects.equals(roleArn(), other.roleArn()) && hasInputDataConfig() == other.hasInputDataConfig() && Objects.equals(inputDataConfig(), other.inputDataConfig()) && Objects.equals(outputDataConfig(), other.outputDataConfig()) && Objects.equals(resourceConfig(), other.resourceConfig()) && Objects.equals(vpcConfig(), other.vpcConfig()) && Objects.equals(stoppingCondition(), other.stoppingCondition()) && hasTags() == other.hasTags() && Objects.equals(tags(), other.tags()) && Objects.equals(enableNetworkIsolation(), other.enableNetworkIsolation()) && Objects.equals(enableInterContainerTrafficEncryption(), other.enableInterContainerTrafficEncryption()) && Objects.equals(enableManagedSpotTraining(), other.enableManagedSpotTraining()) && Objects.equals(checkpointConfig(), other.checkpointConfig()) && Objects.equals(debugHookConfig(), other.debugHookConfig()) && hasDebugRuleConfigurations() == other.hasDebugRuleConfigurations() && Objects.equals(debugRuleConfigurations(), other.debugRuleConfigurations()) && Objects.equals(tensorBoardOutputConfig(), other.tensorBoardOutputConfig()) && Objects.equals(experimentConfig(), other.experimentConfig()) && Objects.equals(profilerConfig(), other.profilerConfig()) && hasProfilerRuleConfigurations() == other.hasProfilerRuleConfigurations() && Objects.equals(profilerRuleConfigurations(), other.profilerRuleConfigurations()) && hasEnvironment() == other.hasEnvironment() && Objects.equals(environment(), other.environment()) && Objects.equals(retryStrategy(), other.retryStrategy()) && Objects.equals(remoteDebugConfig(), other.remoteDebugConfig()) && Objects.equals(infraCheckConfig(), other.infraCheckConfig()) && Objects.equals(sessionChainingConfig(), other.sessionChainingConfig()); } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. */ @Override public final String toString() { return ToString.builder("CreateTrainingJobRequest").add("TrainingJobName", trainingJobName()) .add("HyperParameters", hasHyperParameters() ? hyperParameters() : null) .add("AlgorithmSpecification", algorithmSpecification()).add("RoleArn", roleArn()) .add("InputDataConfig", hasInputDataConfig() ? inputDataConfig() : null) .add("OutputDataConfig", outputDataConfig()).add("ResourceConfig", resourceConfig()) .add("VpcConfig", vpcConfig()).add("StoppingCondition", stoppingCondition()) .add("Tags", hasTags() ? tags() : null).add("EnableNetworkIsolation", enableNetworkIsolation()) .add("EnableInterContainerTrafficEncryption", enableInterContainerTrafficEncryption()) .add("EnableManagedSpotTraining", enableManagedSpotTraining()).add("CheckpointConfig", checkpointConfig()) .add("DebugHookConfig", debugHookConfig()) .add("DebugRuleConfigurations", hasDebugRuleConfigurations() ? debugRuleConfigurations() : null) .add("TensorBoardOutputConfig", tensorBoardOutputConfig()).add("ExperimentConfig", experimentConfig()) .add("ProfilerConfig", profilerConfig()) .add("ProfilerRuleConfigurations", hasProfilerRuleConfigurations() ? profilerRuleConfigurations() : null) .add("Environment", hasEnvironment() ? environment() : null).add("RetryStrategy", retryStrategy()) .add("RemoteDebugConfig", remoteDebugConfig()).add("InfraCheckConfig", infraCheckConfig()) .add("SessionChainingConfig", sessionChainingConfig()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "TrainingJobName": return Optional.ofNullable(clazz.cast(trainingJobName())); case "HyperParameters": return Optional.ofNullable(clazz.cast(hyperParameters())); case "AlgorithmSpecification": return Optional.ofNullable(clazz.cast(algorithmSpecification())); case "RoleArn": return Optional.ofNullable(clazz.cast(roleArn())); case "InputDataConfig": return Optional.ofNullable(clazz.cast(inputDataConfig())); case "OutputDataConfig": return Optional.ofNullable(clazz.cast(outputDataConfig())); case "ResourceConfig": return Optional.ofNullable(clazz.cast(resourceConfig())); case "VpcConfig": return Optional.ofNullable(clazz.cast(vpcConfig())); case "StoppingCondition": return Optional.ofNullable(clazz.cast(stoppingCondition())); case "Tags": return Optional.ofNullable(clazz.cast(tags())); case "EnableNetworkIsolation": return Optional.ofNullable(clazz.cast(enableNetworkIsolation())); case "EnableInterContainerTrafficEncryption": return Optional.ofNullable(clazz.cast(enableInterContainerTrafficEncryption())); case "EnableManagedSpotTraining": return Optional.ofNullable(clazz.cast(enableManagedSpotTraining())); case "CheckpointConfig": return Optional.ofNullable(clazz.cast(checkpointConfig())); case "DebugHookConfig": return Optional.ofNullable(clazz.cast(debugHookConfig())); case "DebugRuleConfigurations": return Optional.ofNullable(clazz.cast(debugRuleConfigurations())); case "TensorBoardOutputConfig": return Optional.ofNullable(clazz.cast(tensorBoardOutputConfig())); case "ExperimentConfig": return Optional.ofNullable(clazz.cast(experimentConfig())); case "ProfilerConfig": return Optional.ofNullable(clazz.cast(profilerConfig())); case "ProfilerRuleConfigurations": return Optional.ofNullable(clazz.cast(profilerRuleConfigurations())); case "Environment": return Optional.ofNullable(clazz.cast(environment())); case "RetryStrategy": return Optional.ofNullable(clazz.cast(retryStrategy())); case "RemoteDebugConfig": return Optional.ofNullable(clazz.cast(remoteDebugConfig())); case "InfraCheckConfig": return Optional.ofNullable(clazz.cast(infraCheckConfig())); case "SessionChainingConfig": return Optional.ofNullable(clazz.cast(sessionChainingConfig())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((CreateTrainingJobRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SageMakerRequest.Builder, SdkPojo, CopyableBuilder { /** *

* The name of the training job. The name must be unique within an Amazon Web Services Region in an Amazon Web * Services account. *

* * @param trainingJobName * The name of the training job. The name must be unique within an Amazon Web Services Region in an * Amazon Web Services account. * @return Returns a reference to this object so that method calls can be chained together. */ Builder trainingJobName(String trainingJobName); /** *

* Algorithm-specific parameters that influence the quality of the model. You set hyperparameters before you * start the learning process. For a list of hyperparameters for each training algorithm provided by SageMaker, * see Algorithms. *

*

* You can specify a maximum of 100 hyperparameters. Each hyperparameter is a key-value pair. Each key and value * is limited to 256 characters, as specified by the Length Constraint. *

* *

* Do not include any security-sensitive information including account access IDs, secrets or tokens in any * hyperparameter field. If the use of security-sensitive credentials are detected, SageMaker will reject your * training job request and return an exception error. *

*
* * @param hyperParameters * Algorithm-specific parameters that influence the quality of the model. You set hyperparameters before * you start the learning process. For a list of hyperparameters for each training algorithm provided by * SageMaker, see Algorithms. *

*

* You can specify a maximum of 100 hyperparameters. Each hyperparameter is a key-value pair. Each key * and value is limited to 256 characters, as specified by the Length Constraint. *

* *

* Do not include any security-sensitive information including account access IDs, secrets or tokens in * any hyperparameter field. If the use of security-sensitive credentials are detected, SageMaker will * reject your training job request and return an exception error. *

* @return Returns a reference to this object so that method calls can be chained together. */ Builder hyperParameters(Map hyperParameters); /** *

* The registry path of the Docker image that contains the training algorithm and algorithm-specific metadata, * including the input mode. For more information about algorithms provided by SageMaker, see Algorithms. For information about * providing your own algorithms, see Using Your Own Algorithms with * Amazon SageMaker. *

* * @param algorithmSpecification * The registry path of the Docker image that contains the training algorithm and algorithm-specific * metadata, including the input mode. For more information about algorithms provided by SageMaker, see * Algorithms. For information * about providing your own algorithms, see Using Your Own Algorithms * with Amazon SageMaker. * @return Returns a reference to this object so that method calls can be chained together. */ Builder algorithmSpecification(AlgorithmSpecification algorithmSpecification); /** *

* The registry path of the Docker image that contains the training algorithm and algorithm-specific metadata, * including the input mode. For more information about algorithms provided by SageMaker, see Algorithms. For information about * providing your own algorithms, see Using Your Own Algorithms with * Amazon SageMaker. *

* This is a convenience method that creates an instance of the {@link AlgorithmSpecification.Builder} avoiding * the need to create one manually via {@link AlgorithmSpecification#builder()}. * *

* When the {@link Consumer} completes, {@link AlgorithmSpecification.Builder#build()} is called immediately and * its result is passed to {@link #algorithmSpecification(AlgorithmSpecification)}. * * @param algorithmSpecification * a consumer that will call methods on {@link AlgorithmSpecification.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #algorithmSpecification(AlgorithmSpecification) */ default Builder algorithmSpecification(Consumer algorithmSpecification) { return algorithmSpecification(AlgorithmSpecification.builder().applyMutation(algorithmSpecification).build()); } /** *

* The Amazon Resource Name (ARN) of an IAM role that SageMaker can assume to perform tasks on your behalf. *

*

* During model training, SageMaker needs your permission to read input data from an S3 bucket, download a * Docker image that contains training code, write model artifacts to an S3 bucket, write logs to Amazon * CloudWatch Logs, and publish metrics to Amazon CloudWatch. You grant permissions for all of these tasks to an * IAM role. For more information, see SageMaker Roles. *

* *

* To be able to pass this role to SageMaker, the caller of this API must have the iam:PassRole * permission. *

*
* * @param roleArn * The Amazon Resource Name (ARN) of an IAM role that SageMaker can assume to perform tasks on your * behalf.

*

* During model training, SageMaker needs your permission to read input data from an S3 bucket, download * a Docker image that contains training code, write model artifacts to an S3 bucket, write logs to * Amazon CloudWatch Logs, and publish metrics to Amazon CloudWatch. You grant permissions for all of * these tasks to an IAM role. For more information, see SageMaker Roles. *

* *

* To be able to pass this role to SageMaker, the caller of this API must have the * iam:PassRole permission. *

* @return Returns a reference to this object so that method calls can be chained together. */ Builder roleArn(String roleArn); /** *

* An array of Channel objects. Each channel is a named input source. InputDataConfig * describes the input data and its location. *

*

* Algorithms can accept input data from one or more channels. For example, an algorithm might have two channels * of input data, training_data and validation_data. The configuration for each * channel provides the S3, EFS, or FSx location where the input data is stored. It also provides information * about the stored data: the MIME type, compression method, and whether the data is wrapped in RecordIO format. *

*

* Depending on the input mode that the algorithm supports, SageMaker either copies input data files from an S3 * bucket to a local directory in the Docker container, or makes it available as input streams. For example, if * you specify an EFS location, input data files are available as input streams. They do not need to be * downloaded. *

*

* Your input must be in the same Amazon Web Services region as your training job. *

* * @param inputDataConfig * An array of Channel objects. Each channel is a named input source. * InputDataConfig describes the input data and its location.

*

* Algorithms can accept input data from one or more channels. For example, an algorithm might have two * channels of input data, training_data and validation_data. The configuration * for each channel provides the S3, EFS, or FSx location where the input data is stored. It also * provides information about the stored data: the MIME type, compression method, and whether the data is * wrapped in RecordIO format. *

*

* Depending on the input mode that the algorithm supports, SageMaker either copies input data files from * an S3 bucket to a local directory in the Docker container, or makes it available as input streams. For * example, if you specify an EFS location, input data files are available as input streams. They do not * need to be downloaded. *

*

* Your input must be in the same Amazon Web Services region as your training job. * @return Returns a reference to this object so that method calls can be chained together. */ Builder inputDataConfig(Collection inputDataConfig); /** *

* An array of Channel objects. Each channel is a named input source. InputDataConfig * describes the input data and its location. *

*

* Algorithms can accept input data from one or more channels. For example, an algorithm might have two channels * of input data, training_data and validation_data. The configuration for each * channel provides the S3, EFS, or FSx location where the input data is stored. It also provides information * about the stored data: the MIME type, compression method, and whether the data is wrapped in RecordIO format. *

*

* Depending on the input mode that the algorithm supports, SageMaker either copies input data files from an S3 * bucket to a local directory in the Docker container, or makes it available as input streams. For example, if * you specify an EFS location, input data files are available as input streams. They do not need to be * downloaded. *

*

* Your input must be in the same Amazon Web Services region as your training job. *

* * @param inputDataConfig * An array of Channel objects. Each channel is a named input source. * InputDataConfig describes the input data and its location.

*

* Algorithms can accept input data from one or more channels. For example, an algorithm might have two * channels of input data, training_data and validation_data. The configuration * for each channel provides the S3, EFS, or FSx location where the input data is stored. It also * provides information about the stored data: the MIME type, compression method, and whether the data is * wrapped in RecordIO format. *

*

* Depending on the input mode that the algorithm supports, SageMaker either copies input data files from * an S3 bucket to a local directory in the Docker container, or makes it available as input streams. For * example, if you specify an EFS location, input data files are available as input streams. They do not * need to be downloaded. *

*

* Your input must be in the same Amazon Web Services region as your training job. * @return Returns a reference to this object so that method calls can be chained together. */ Builder inputDataConfig(Channel... inputDataConfig); /** *

* An array of Channel objects. Each channel is a named input source. InputDataConfig * describes the input data and its location. *

*

* Algorithms can accept input data from one or more channels. For example, an algorithm might have two channels * of input data, training_data and validation_data. The configuration for each * channel provides the S3, EFS, or FSx location where the input data is stored. It also provides information * about the stored data: the MIME type, compression method, and whether the data is wrapped in RecordIO format. *

*

* Depending on the input mode that the algorithm supports, SageMaker either copies input data files from an S3 * bucket to a local directory in the Docker container, or makes it available as input streams. For example, if * you specify an EFS location, input data files are available as input streams. They do not need to be * downloaded. *

*

* Your input must be in the same Amazon Web Services region as your training job. *

* This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.sagemaker.model.Channel.Builder} avoiding the need to create one * manually via {@link software.amazon.awssdk.services.sagemaker.model.Channel#builder()}. * *

* When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.sagemaker.model.Channel.Builder#build()} is called immediately and its * result is passed to {@link #inputDataConfig(List)}. * * @param inputDataConfig * a consumer that will call methods on * {@link software.amazon.awssdk.services.sagemaker.model.Channel.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #inputDataConfig(java.util.Collection) */ Builder inputDataConfig(Consumer... inputDataConfig); /** *

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

* * @param outputDataConfig * Specifies the path to the S3 location where you want to store model artifacts. SageMaker creates * subfolders for the artifacts. * @return Returns a reference to this object so that method calls can be chained together. */ Builder outputDataConfig(OutputDataConfig outputDataConfig); /** *

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

* This is a convenience method that creates an instance of the {@link OutputDataConfig.Builder} avoiding the * need to create one manually via {@link OutputDataConfig#builder()}. * *

* When the {@link Consumer} completes, {@link OutputDataConfig.Builder#build()} is called immediately and its * result is passed to {@link #outputDataConfig(OutputDataConfig)}. * * @param outputDataConfig * a consumer that will call methods on {@link OutputDataConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #outputDataConfig(OutputDataConfig) */ default Builder outputDataConfig(Consumer outputDataConfig) { return outputDataConfig(OutputDataConfig.builder().applyMutation(outputDataConfig).build()); } /** *

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

*

* ML storage volumes store model artifacts and incremental states. Training algorithms might also use ML * storage volumes for scratch space. If you want SageMaker to use the ML storage volume to store the training * data, choose File as the TrainingInputMode in the algorithm specification. For * distributed training algorithms, specify an instance count greater than 1. *

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

*

* ML storage volumes store model artifacts and incremental states. Training algorithms might also use ML * storage volumes for scratch space. If you want SageMaker to use the ML storage volume to store the * training data, choose File as the TrainingInputMode in the algorithm * specification. For distributed training algorithms, specify an instance count greater than 1. * @return Returns a reference to this object so that method calls can be chained together. */ Builder resourceConfig(ResourceConfig resourceConfig); /** *

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

*

* ML storage volumes store model artifacts and incremental states. Training algorithms might also use ML * storage volumes for scratch space. If you want SageMaker to use the ML storage volume to store the training * data, choose File as the TrainingInputMode in the algorithm specification. For * distributed training algorithms, specify an instance count greater than 1. *

* This is a convenience method that creates an instance of the {@link ResourceConfig.Builder} avoiding the need * to create one manually via {@link ResourceConfig#builder()}. * *

* When the {@link Consumer} completes, {@link ResourceConfig.Builder#build()} is called immediately and its * result is passed to {@link #resourceConfig(ResourceConfig)}. * * @param resourceConfig * a consumer that will call methods on {@link ResourceConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #resourceConfig(ResourceConfig) */ default Builder resourceConfig(Consumer resourceConfig) { return resourceConfig(ResourceConfig.builder().applyMutation(resourceConfig).build()); } /** *

* A VpcConfig object * that specifies the VPC that you want your training job to connect to. Control access to and from your * training container by configuring the VPC. For more information, see Protect Training Jobs by Using an * Amazon Virtual Private Cloud. *

* * @param vpcConfig * A VpcConfig * object that specifies the VPC that you want your training job to connect to. Control access to and * from your training container by configuring the VPC. For more information, see Protect Training Jobs by Using * an Amazon Virtual Private Cloud. * @return Returns a reference to this object so that method calls can be chained together. */ Builder vpcConfig(VpcConfig vpcConfig); /** *

* A VpcConfig object * that specifies the VPC that you want your training job to connect to. Control access to and from your * training container by configuring the VPC. For more information, see Protect Training Jobs by Using an * Amazon Virtual Private Cloud. *

* This is a convenience method that creates an instance of the {@link VpcConfig.Builder} avoiding the need to * create one manually via {@link VpcConfig#builder()}. * *

* When the {@link Consumer} completes, {@link VpcConfig.Builder#build()} is called immediately and its result * is passed to {@link #vpcConfig(VpcConfig)}. * * @param vpcConfig * a consumer that will call methods on {@link VpcConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #vpcConfig(VpcConfig) */ default Builder vpcConfig(Consumer vpcConfig) { return vpcConfig(VpcConfig.builder().applyMutation(vpcConfig).build()); } /** *

* 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, so the results of * training are not lost. *

* * @param 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, so * the results of training are not lost. * @return Returns a reference to this object so that method calls can be chained together. */ Builder stoppingCondition(StoppingCondition 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, so the results of * training are not lost. *

* This is a convenience method that creates an instance of the {@link StoppingCondition.Builder} avoiding the * need to create one manually via {@link StoppingCondition#builder()}. * *

* When the {@link Consumer} completes, {@link StoppingCondition.Builder#build()} is called immediately and its * result is passed to {@link #stoppingCondition(StoppingCondition)}. * * @param stoppingCondition * a consumer that will call methods on {@link StoppingCondition.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #stoppingCondition(StoppingCondition) */ default Builder stoppingCondition(Consumer stoppingCondition) { return stoppingCondition(StoppingCondition.builder().applyMutation(stoppingCondition).build()); } /** *

* An array of key-value pairs. You can use tags to categorize your Amazon Web Services resources in different * ways, for example, by purpose, owner, or environment. For more information, see Tagging Amazon Web Services * Resources. *

* * @param tags * An array of key-value pairs. You can use tags to categorize your Amazon Web Services resources in * different ways, for example, by purpose, owner, or environment. For more information, see Tagging Amazon Web Services * Resources. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tags(Collection tags); /** *

* An array of key-value pairs. You can use tags to categorize your Amazon Web Services resources in different * ways, for example, by purpose, owner, or environment. For more information, see Tagging Amazon Web Services * Resources. *

* * @param tags * An array of key-value pairs. You can use tags to categorize your Amazon Web Services resources in * different ways, for example, by purpose, owner, or environment. For more information, see Tagging Amazon Web Services * Resources. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tags(Tag... tags); /** *

* An array of key-value pairs. You can use tags to categorize your Amazon Web Services resources in different * ways, for example, by purpose, owner, or environment. For more information, see Tagging Amazon Web Services * Resources. *

* This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.sagemaker.model.Tag.Builder} avoiding the need to create one manually * via {@link software.amazon.awssdk.services.sagemaker.model.Tag#builder()}. * *

* When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.sagemaker.model.Tag.Builder#build()} is called immediately and its * result is passed to {@link #tags(List)}. * * @param tags * a consumer that will call methods on * {@link software.amazon.awssdk.services.sagemaker.model.Tag.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #tags(java.util.Collection) */ Builder tags(Consumer... tags); /** *

* Isolates the training container. No inbound or outbound network calls can be made, except for calls between * peers within a training cluster for distributed training. If you enable network isolation for training jobs * that are configured to use a VPC, SageMaker downloads and uploads customer data and model artifacts through * the specified VPC, but the training container does not have network access. *

* * @param enableNetworkIsolation * Isolates the training container. No inbound or outbound network calls can be made, except for calls * between peers within a training cluster for distributed training. If you enable network isolation for * training jobs that are configured to use a VPC, SageMaker downloads and uploads customer data and * model artifacts through the specified VPC, but the training container does not have network access. * @return Returns a reference to this object so that method calls can be chained together. */ Builder enableNetworkIsolation(Boolean enableNetworkIsolation); /** *

* To encrypt all communications between ML compute instances in distributed training, choose True. * Encryption provides greater security for distributed training, but training might take longer. How long it * takes depends on the amount of communication between compute instances, especially if you use a deep learning * algorithm in distributed training. For more information, see Protect Communications Between ML * Compute Instances in a Distributed Training Job. *

* * @param enableInterContainerTrafficEncryption * To encrypt all communications between ML compute instances in distributed training, choose * True. Encryption provides greater security for distributed training, but training might * take longer. How long it takes depends on the amount of communication between compute instances, * especially if you use a deep learning algorithm in distributed training. For more information, see Protect Communications * Between ML Compute Instances in a Distributed Training Job. * @return Returns a reference to this object so that method calls can be chained together. */ Builder enableInterContainerTrafficEncryption(Boolean enableInterContainerTrafficEncryption); /** *

* To train models using managed spot training, choose True. Managed spot training provides a fully * managed and scalable infrastructure for training machine learning models. this option is useful when training * jobs can be interrupted and when there is flexibility when the training job is run. *

*

* The complete and intermediate results of jobs are stored in an Amazon S3 bucket, and can be used as a * starting point to train models incrementally. Amazon SageMaker provides metrics and logs in CloudWatch. They * can be used to see when managed spot training jobs are running, interrupted, resumed, or completed. *

* * @param enableManagedSpotTraining * To train models using managed spot training, choose True. Managed spot training provides * a fully managed and scalable infrastructure for training machine learning models. this option is * useful when training jobs can be interrupted and when there is flexibility when the training job is * run.

*

* The complete and intermediate results of jobs are stored in an Amazon S3 bucket, and can be used as a * starting point to train models incrementally. Amazon SageMaker provides metrics and logs in * CloudWatch. They can be used to see when managed spot training jobs are running, interrupted, resumed, * or completed. * @return Returns a reference to this object so that method calls can be chained together. */ Builder enableManagedSpotTraining(Boolean enableManagedSpotTraining); /** *

* Contains information about the output location for managed spot training checkpoint data. *

* * @param checkpointConfig * Contains information about the output location for managed spot training checkpoint data. * @return Returns a reference to this object so that method calls can be chained together. */ Builder checkpointConfig(CheckpointConfig checkpointConfig); /** *

* Contains information about the output location for managed spot training checkpoint data. *

* This is a convenience method that creates an instance of the {@link CheckpointConfig.Builder} avoiding the * need to create one manually via {@link CheckpointConfig#builder()}. * *

* When the {@link Consumer} completes, {@link CheckpointConfig.Builder#build()} is called immediately and its * result is passed to {@link #checkpointConfig(CheckpointConfig)}. * * @param checkpointConfig * a consumer that will call methods on {@link CheckpointConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #checkpointConfig(CheckpointConfig) */ default Builder checkpointConfig(Consumer checkpointConfig) { return checkpointConfig(CheckpointConfig.builder().applyMutation(checkpointConfig).build()); } /** * Sets the value of the DebugHookConfig property for this object. * * @param debugHookConfig * The new value for the DebugHookConfig property for this object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder debugHookConfig(DebugHookConfig debugHookConfig); /** * Sets the value of the DebugHookConfig property for this object. * * This is a convenience method that creates an instance of the {@link DebugHookConfig.Builder} avoiding the * need to create one manually via {@link DebugHookConfig#builder()}. * *

* When the {@link Consumer} completes, {@link DebugHookConfig.Builder#build()} is called immediately and its * result is passed to {@link #debugHookConfig(DebugHookConfig)}. * * @param debugHookConfig * a consumer that will call methods on {@link DebugHookConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #debugHookConfig(DebugHookConfig) */ default Builder debugHookConfig(Consumer debugHookConfig) { return debugHookConfig(DebugHookConfig.builder().applyMutation(debugHookConfig).build()); } /** *

* Configuration information for Amazon SageMaker Debugger rules for debugging output tensors. *

* * @param debugRuleConfigurations * Configuration information for Amazon SageMaker Debugger rules for debugging output tensors. * @return Returns a reference to this object so that method calls can be chained together. */ Builder debugRuleConfigurations(Collection debugRuleConfigurations); /** *

* Configuration information for Amazon SageMaker Debugger rules for debugging output tensors. *

* * @param debugRuleConfigurations * Configuration information for Amazon SageMaker Debugger rules for debugging output tensors. * @return Returns a reference to this object so that method calls can be chained together. */ Builder debugRuleConfigurations(DebugRuleConfiguration... debugRuleConfigurations); /** *

* Configuration information for Amazon SageMaker Debugger rules for debugging output tensors. *

* This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.sagemaker.model.DebugRuleConfiguration.Builder} avoiding the need to * create one manually via * {@link software.amazon.awssdk.services.sagemaker.model.DebugRuleConfiguration#builder()}. * *

* When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.sagemaker.model.DebugRuleConfiguration.Builder#build()} is called * immediately and its result is passed to {@link #debugRuleConfigurations(List)}. * * @param debugRuleConfigurations * a consumer that will call methods on * {@link software.amazon.awssdk.services.sagemaker.model.DebugRuleConfiguration.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #debugRuleConfigurations(java.util.Collection) */ Builder debugRuleConfigurations(Consumer... debugRuleConfigurations); /** * Sets the value of the TensorBoardOutputConfig property for this object. * * @param tensorBoardOutputConfig * The new value for the TensorBoardOutputConfig property for this object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tensorBoardOutputConfig(TensorBoardOutputConfig tensorBoardOutputConfig); /** * Sets the value of the TensorBoardOutputConfig property for this object. * * This is a convenience method that creates an instance of the {@link TensorBoardOutputConfig.Builder} avoiding * the need to create one manually via {@link TensorBoardOutputConfig#builder()}. * *

* When the {@link Consumer} completes, {@link TensorBoardOutputConfig.Builder#build()} is called immediately * and its result is passed to {@link #tensorBoardOutputConfig(TensorBoardOutputConfig)}. * * @param tensorBoardOutputConfig * a consumer that will call methods on {@link TensorBoardOutputConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #tensorBoardOutputConfig(TensorBoardOutputConfig) */ default Builder tensorBoardOutputConfig(Consumer tensorBoardOutputConfig) { return tensorBoardOutputConfig(TensorBoardOutputConfig.builder().applyMutation(tensorBoardOutputConfig).build()); } /** * Sets the value of the ExperimentConfig property for this object. * * @param experimentConfig * The new value for the ExperimentConfig property for this object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder experimentConfig(ExperimentConfig experimentConfig); /** * Sets the value of the ExperimentConfig property for this object. * * This is a convenience method that creates an instance of the {@link ExperimentConfig.Builder} avoiding the * need to create one manually via {@link ExperimentConfig#builder()}. * *

* When the {@link Consumer} completes, {@link ExperimentConfig.Builder#build()} is called immediately and its * result is passed to {@link #experimentConfig(ExperimentConfig)}. * * @param experimentConfig * a consumer that will call methods on {@link ExperimentConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #experimentConfig(ExperimentConfig) */ default Builder experimentConfig(Consumer experimentConfig) { return experimentConfig(ExperimentConfig.builder().applyMutation(experimentConfig).build()); } /** * Sets the value of the ProfilerConfig property for this object. * * @param profilerConfig * The new value for the ProfilerConfig property for this object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder profilerConfig(ProfilerConfig profilerConfig); /** * Sets the value of the ProfilerConfig property for this object. * * This is a convenience method that creates an instance of the {@link ProfilerConfig.Builder} avoiding the need * to create one manually via {@link ProfilerConfig#builder()}. * *

* When the {@link Consumer} completes, {@link ProfilerConfig.Builder#build()} is called immediately and its * result is passed to {@link #profilerConfig(ProfilerConfig)}. * * @param profilerConfig * a consumer that will call methods on {@link ProfilerConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #profilerConfig(ProfilerConfig) */ default Builder profilerConfig(Consumer profilerConfig) { return profilerConfig(ProfilerConfig.builder().applyMutation(profilerConfig).build()); } /** *

* Configuration information for Amazon SageMaker Debugger rules for profiling system and framework metrics. *

* * @param profilerRuleConfigurations * Configuration information for Amazon SageMaker Debugger rules for profiling system and framework * metrics. * @return Returns a reference to this object so that method calls can be chained together. */ Builder profilerRuleConfigurations(Collection profilerRuleConfigurations); /** *

* Configuration information for Amazon SageMaker Debugger rules for profiling system and framework metrics. *

* * @param profilerRuleConfigurations * Configuration information for Amazon SageMaker Debugger rules for profiling system and framework * metrics. * @return Returns a reference to this object so that method calls can be chained together. */ Builder profilerRuleConfigurations(ProfilerRuleConfiguration... profilerRuleConfigurations); /** *

* Configuration information for Amazon SageMaker Debugger rules for profiling system and framework metrics. *

* This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.sagemaker.model.ProfilerRuleConfiguration.Builder} avoiding the need * to create one manually via * {@link software.amazon.awssdk.services.sagemaker.model.ProfilerRuleConfiguration#builder()}. * *

* When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.sagemaker.model.ProfilerRuleConfiguration.Builder#build()} is called * immediately and its result is passed to {@link #profilerRuleConfigurations(List)}. * * @param profilerRuleConfigurations * a consumer that will call methods on * {@link software.amazon.awssdk.services.sagemaker.model.ProfilerRuleConfiguration.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #profilerRuleConfigurations(java.util.Collection) */ Builder profilerRuleConfigurations(Consumer... profilerRuleConfigurations); /** *

* The environment variables to set in the Docker container. *

* * @param environment * The environment variables to set in the Docker container. * @return Returns a reference to this object so that method calls can be chained together. */ Builder environment(Map environment); /** *

* The number of times to retry the job when the job fails due to an InternalServerError. *

* * @param retryStrategy * The number of times to retry the job when the job fails due to an InternalServerError. * @return Returns a reference to this object so that method calls can be chained together. */ Builder retryStrategy(RetryStrategy retryStrategy); /** *

* The number of times to retry the job when the job fails due to an InternalServerError. *

* This is a convenience method that creates an instance of the {@link RetryStrategy.Builder} avoiding the need * to create one manually via {@link RetryStrategy#builder()}. * *

* When the {@link Consumer} completes, {@link RetryStrategy.Builder#build()} is called immediately and its * result is passed to {@link #retryStrategy(RetryStrategy)}. * * @param retryStrategy * a consumer that will call methods on {@link RetryStrategy.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #retryStrategy(RetryStrategy) */ default Builder retryStrategy(Consumer retryStrategy) { return retryStrategy(RetryStrategy.builder().applyMutation(retryStrategy).build()); } /** *

* Configuration for remote debugging. To learn more about the remote debugging functionality of SageMaker, see * Access a training * container through Amazon Web Services Systems Manager (SSM) for remote debugging. *

* * @param remoteDebugConfig * Configuration for remote debugging. To learn more about the remote debugging functionality of * SageMaker, see Access a training * container through Amazon Web Services Systems Manager (SSM) for remote debugging. * @return Returns a reference to this object so that method calls can be chained together. */ Builder remoteDebugConfig(RemoteDebugConfig remoteDebugConfig); /** *

* Configuration for remote debugging. To learn more about the remote debugging functionality of SageMaker, see * Access a training * container through Amazon Web Services Systems Manager (SSM) for remote debugging. *

* This is a convenience method that creates an instance of the {@link RemoteDebugConfig.Builder} avoiding the * need to create one manually via {@link RemoteDebugConfig#builder()}. * *

* When the {@link Consumer} completes, {@link RemoteDebugConfig.Builder#build()} is called immediately and its * result is passed to {@link #remoteDebugConfig(RemoteDebugConfig)}. * * @param remoteDebugConfig * a consumer that will call methods on {@link RemoteDebugConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #remoteDebugConfig(RemoteDebugConfig) */ default Builder remoteDebugConfig(Consumer remoteDebugConfig) { return remoteDebugConfig(RemoteDebugConfig.builder().applyMutation(remoteDebugConfig).build()); } /** *

* Contains information about the infrastructure health check configuration for the training job. *

* * @param infraCheckConfig * Contains information about the infrastructure health check configuration for the training job. * @return Returns a reference to this object so that method calls can be chained together. */ Builder infraCheckConfig(InfraCheckConfig infraCheckConfig); /** *

* Contains information about the infrastructure health check configuration for the training job. *

* This is a convenience method that creates an instance of the {@link InfraCheckConfig.Builder} avoiding the * need to create one manually via {@link InfraCheckConfig#builder()}. * *

* When the {@link Consumer} completes, {@link InfraCheckConfig.Builder#build()} is called immediately and its * result is passed to {@link #infraCheckConfig(InfraCheckConfig)}. * * @param infraCheckConfig * a consumer that will call methods on {@link InfraCheckConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #infraCheckConfig(InfraCheckConfig) */ default Builder infraCheckConfig(Consumer infraCheckConfig) { return infraCheckConfig(InfraCheckConfig.builder().applyMutation(infraCheckConfig).build()); } /** *

* Contains information about attribute-based access control (ABAC) for the training job. *

* * @param sessionChainingConfig * Contains information about attribute-based access control (ABAC) for the training job. * @return Returns a reference to this object so that method calls can be chained together. */ Builder sessionChainingConfig(SessionChainingConfig sessionChainingConfig); /** *

* Contains information about attribute-based access control (ABAC) for the training job. *

* This is a convenience method that creates an instance of the {@link SessionChainingConfig.Builder} avoiding * the need to create one manually via {@link SessionChainingConfig#builder()}. * *

* When the {@link Consumer} completes, {@link SessionChainingConfig.Builder#build()} is called immediately and * its result is passed to {@link #sessionChainingConfig(SessionChainingConfig)}. * * @param sessionChainingConfig * a consumer that will call methods on {@link SessionChainingConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #sessionChainingConfig(SessionChainingConfig) */ default Builder sessionChainingConfig(Consumer sessionChainingConfig) { return sessionChainingConfig(SessionChainingConfig.builder().applyMutation(sessionChainingConfig).build()); } @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends SageMakerRequest.BuilderImpl implements Builder { private String trainingJobName; private Map hyperParameters = DefaultSdkAutoConstructMap.getInstance(); private AlgorithmSpecification algorithmSpecification; private String roleArn; private List inputDataConfig = DefaultSdkAutoConstructList.getInstance(); private OutputDataConfig outputDataConfig; private ResourceConfig resourceConfig; private VpcConfig vpcConfig; private StoppingCondition stoppingCondition; private List tags = DefaultSdkAutoConstructList.getInstance(); private Boolean enableNetworkIsolation; private Boolean enableInterContainerTrafficEncryption; private Boolean enableManagedSpotTraining; private CheckpointConfig checkpointConfig; private DebugHookConfig debugHookConfig; private List debugRuleConfigurations = DefaultSdkAutoConstructList.getInstance(); private TensorBoardOutputConfig tensorBoardOutputConfig; private ExperimentConfig experimentConfig; private ProfilerConfig profilerConfig; private List profilerRuleConfigurations = DefaultSdkAutoConstructList.getInstance(); private Map environment = DefaultSdkAutoConstructMap.getInstance(); private RetryStrategy retryStrategy; private RemoteDebugConfig remoteDebugConfig; private InfraCheckConfig infraCheckConfig; private SessionChainingConfig sessionChainingConfig; private BuilderImpl() { } private BuilderImpl(CreateTrainingJobRequest model) { super(model); trainingJobName(model.trainingJobName); hyperParameters(model.hyperParameters); algorithmSpecification(model.algorithmSpecification); roleArn(model.roleArn); inputDataConfig(model.inputDataConfig); outputDataConfig(model.outputDataConfig); resourceConfig(model.resourceConfig); vpcConfig(model.vpcConfig); stoppingCondition(model.stoppingCondition); tags(model.tags); enableNetworkIsolation(model.enableNetworkIsolation); enableInterContainerTrafficEncryption(model.enableInterContainerTrafficEncryption); enableManagedSpotTraining(model.enableManagedSpotTraining); checkpointConfig(model.checkpointConfig); debugHookConfig(model.debugHookConfig); debugRuleConfigurations(model.debugRuleConfigurations); tensorBoardOutputConfig(model.tensorBoardOutputConfig); experimentConfig(model.experimentConfig); profilerConfig(model.profilerConfig); profilerRuleConfigurations(model.profilerRuleConfigurations); environment(model.environment); retryStrategy(model.retryStrategy); remoteDebugConfig(model.remoteDebugConfig); infraCheckConfig(model.infraCheckConfig); sessionChainingConfig(model.sessionChainingConfig); } public final String getTrainingJobName() { return trainingJobName; } public final void setTrainingJobName(String trainingJobName) { this.trainingJobName = trainingJobName; } @Override public final Builder trainingJobName(String trainingJobName) { this.trainingJobName = trainingJobName; return this; } public final Map getHyperParameters() { if (hyperParameters instanceof SdkAutoConstructMap) { return null; } return hyperParameters; } public final void setHyperParameters(Map hyperParameters) { this.hyperParameters = HyperParametersCopier.copy(hyperParameters); } @Override public final Builder hyperParameters(Map hyperParameters) { this.hyperParameters = HyperParametersCopier.copy(hyperParameters); return this; } public final AlgorithmSpecification.Builder getAlgorithmSpecification() { return algorithmSpecification != null ? algorithmSpecification.toBuilder() : null; } public final void setAlgorithmSpecification(AlgorithmSpecification.BuilderImpl algorithmSpecification) { this.algorithmSpecification = algorithmSpecification != null ? algorithmSpecification.build() : null; } @Override public final Builder algorithmSpecification(AlgorithmSpecification algorithmSpecification) { this.algorithmSpecification = algorithmSpecification; return this; } public final String getRoleArn() { return roleArn; } public final void setRoleArn(String roleArn) { this.roleArn = roleArn; } @Override public final Builder roleArn(String roleArn) { this.roleArn = roleArn; return this; } public final List getInputDataConfig() { List result = InputDataConfigCopier.copyToBuilder(this.inputDataConfig); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setInputDataConfig(Collection inputDataConfig) { this.inputDataConfig = InputDataConfigCopier.copyFromBuilder(inputDataConfig); } @Override public final Builder inputDataConfig(Collection inputDataConfig) { this.inputDataConfig = InputDataConfigCopier.copy(inputDataConfig); return this; } @Override @SafeVarargs public final Builder inputDataConfig(Channel... inputDataConfig) { inputDataConfig(Arrays.asList(inputDataConfig)); return this; } @Override @SafeVarargs public final Builder inputDataConfig(Consumer... inputDataConfig) { inputDataConfig(Stream.of(inputDataConfig).map(c -> Channel.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } public final OutputDataConfig.Builder getOutputDataConfig() { return outputDataConfig != null ? outputDataConfig.toBuilder() : null; } public final void setOutputDataConfig(OutputDataConfig.BuilderImpl outputDataConfig) { this.outputDataConfig = outputDataConfig != null ? outputDataConfig.build() : null; } @Override public final Builder outputDataConfig(OutputDataConfig outputDataConfig) { this.outputDataConfig = outputDataConfig; return this; } public final ResourceConfig.Builder getResourceConfig() { return resourceConfig != null ? resourceConfig.toBuilder() : null; } public final void setResourceConfig(ResourceConfig.BuilderImpl resourceConfig) { this.resourceConfig = resourceConfig != null ? resourceConfig.build() : null; } @Override public final Builder resourceConfig(ResourceConfig resourceConfig) { this.resourceConfig = resourceConfig; return this; } public final VpcConfig.Builder getVpcConfig() { return vpcConfig != null ? vpcConfig.toBuilder() : null; } public final void setVpcConfig(VpcConfig.BuilderImpl vpcConfig) { this.vpcConfig = vpcConfig != null ? vpcConfig.build() : null; } @Override public final Builder vpcConfig(VpcConfig vpcConfig) { this.vpcConfig = vpcConfig; return this; } public final StoppingCondition.Builder getStoppingCondition() { return stoppingCondition != null ? stoppingCondition.toBuilder() : null; } public final void setStoppingCondition(StoppingCondition.BuilderImpl stoppingCondition) { this.stoppingCondition = stoppingCondition != null ? stoppingCondition.build() : null; } @Override public final Builder stoppingCondition(StoppingCondition stoppingCondition) { this.stoppingCondition = stoppingCondition; return this; } public final List getTags() { List result = TagListCopier.copyToBuilder(this.tags); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setTags(Collection tags) { this.tags = TagListCopier.copyFromBuilder(tags); } @Override public final Builder tags(Collection tags) { this.tags = TagListCopier.copy(tags); return this; } @Override @SafeVarargs public final Builder tags(Tag... tags) { tags(Arrays.asList(tags)); return this; } @Override @SafeVarargs public final Builder tags(Consumer... tags) { tags(Stream.of(tags).map(c -> Tag.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; } public final Boolean getEnableNetworkIsolation() { return enableNetworkIsolation; } public final void setEnableNetworkIsolation(Boolean enableNetworkIsolation) { this.enableNetworkIsolation = enableNetworkIsolation; } @Override public final Builder enableNetworkIsolation(Boolean enableNetworkIsolation) { this.enableNetworkIsolation = enableNetworkIsolation; return this; } public final Boolean getEnableInterContainerTrafficEncryption() { return enableInterContainerTrafficEncryption; } public final void setEnableInterContainerTrafficEncryption(Boolean enableInterContainerTrafficEncryption) { this.enableInterContainerTrafficEncryption = enableInterContainerTrafficEncryption; } @Override public final Builder enableInterContainerTrafficEncryption(Boolean enableInterContainerTrafficEncryption) { this.enableInterContainerTrafficEncryption = enableInterContainerTrafficEncryption; return this; } public final Boolean getEnableManagedSpotTraining() { return enableManagedSpotTraining; } public final void setEnableManagedSpotTraining(Boolean enableManagedSpotTraining) { this.enableManagedSpotTraining = enableManagedSpotTraining; } @Override public final Builder enableManagedSpotTraining(Boolean enableManagedSpotTraining) { this.enableManagedSpotTraining = enableManagedSpotTraining; return this; } public final CheckpointConfig.Builder getCheckpointConfig() { return checkpointConfig != null ? checkpointConfig.toBuilder() : null; } public final void setCheckpointConfig(CheckpointConfig.BuilderImpl checkpointConfig) { this.checkpointConfig = checkpointConfig != null ? checkpointConfig.build() : null; } @Override public final Builder checkpointConfig(CheckpointConfig checkpointConfig) { this.checkpointConfig = checkpointConfig; return this; } public final DebugHookConfig.Builder getDebugHookConfig() { return debugHookConfig != null ? debugHookConfig.toBuilder() : null; } public final void setDebugHookConfig(DebugHookConfig.BuilderImpl debugHookConfig) { this.debugHookConfig = debugHookConfig != null ? debugHookConfig.build() : null; } @Override public final Builder debugHookConfig(DebugHookConfig debugHookConfig) { this.debugHookConfig = debugHookConfig; return this; } public final List getDebugRuleConfigurations() { List result = DebugRuleConfigurationsCopier .copyToBuilder(this.debugRuleConfigurations); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setDebugRuleConfigurations(Collection debugRuleConfigurations) { this.debugRuleConfigurations = DebugRuleConfigurationsCopier.copyFromBuilder(debugRuleConfigurations); } @Override public final Builder debugRuleConfigurations(Collection debugRuleConfigurations) { this.debugRuleConfigurations = DebugRuleConfigurationsCopier.copy(debugRuleConfigurations); return this; } @Override @SafeVarargs public final Builder debugRuleConfigurations(DebugRuleConfiguration... debugRuleConfigurations) { debugRuleConfigurations(Arrays.asList(debugRuleConfigurations)); return this; } @Override @SafeVarargs public final Builder debugRuleConfigurations(Consumer... debugRuleConfigurations) { debugRuleConfigurations(Stream.of(debugRuleConfigurations) .map(c -> DebugRuleConfiguration.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; } public final TensorBoardOutputConfig.Builder getTensorBoardOutputConfig() { return tensorBoardOutputConfig != null ? tensorBoardOutputConfig.toBuilder() : null; } public final void setTensorBoardOutputConfig(TensorBoardOutputConfig.BuilderImpl tensorBoardOutputConfig) { this.tensorBoardOutputConfig = tensorBoardOutputConfig != null ? tensorBoardOutputConfig.build() : null; } @Override public final Builder tensorBoardOutputConfig(TensorBoardOutputConfig tensorBoardOutputConfig) { this.tensorBoardOutputConfig = tensorBoardOutputConfig; return this; } public final ExperimentConfig.Builder getExperimentConfig() { return experimentConfig != null ? experimentConfig.toBuilder() : null; } public final void setExperimentConfig(ExperimentConfig.BuilderImpl experimentConfig) { this.experimentConfig = experimentConfig != null ? experimentConfig.build() : null; } @Override public final Builder experimentConfig(ExperimentConfig experimentConfig) { this.experimentConfig = experimentConfig; return this; } public final ProfilerConfig.Builder getProfilerConfig() { return profilerConfig != null ? profilerConfig.toBuilder() : null; } public final void setProfilerConfig(ProfilerConfig.BuilderImpl profilerConfig) { this.profilerConfig = profilerConfig != null ? profilerConfig.build() : null; } @Override public final Builder profilerConfig(ProfilerConfig profilerConfig) { this.profilerConfig = profilerConfig; return this; } public final List getProfilerRuleConfigurations() { List result = ProfilerRuleConfigurationsCopier .copyToBuilder(this.profilerRuleConfigurations); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setProfilerRuleConfigurations( Collection profilerRuleConfigurations) { this.profilerRuleConfigurations = ProfilerRuleConfigurationsCopier.copyFromBuilder(profilerRuleConfigurations); } @Override public final Builder profilerRuleConfigurations(Collection profilerRuleConfigurations) { this.profilerRuleConfigurations = ProfilerRuleConfigurationsCopier.copy(profilerRuleConfigurations); return this; } @Override @SafeVarargs public final Builder profilerRuleConfigurations(ProfilerRuleConfiguration... profilerRuleConfigurations) { profilerRuleConfigurations(Arrays.asList(profilerRuleConfigurations)); return this; } @Override @SafeVarargs public final Builder profilerRuleConfigurations(Consumer... profilerRuleConfigurations) { profilerRuleConfigurations(Stream.of(profilerRuleConfigurations) .map(c -> ProfilerRuleConfiguration.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; } public final Map getEnvironment() { if (environment instanceof SdkAutoConstructMap) { return null; } return environment; } public final void setEnvironment(Map environment) { this.environment = TrainingEnvironmentMapCopier.copy(environment); } @Override public final Builder environment(Map environment) { this.environment = TrainingEnvironmentMapCopier.copy(environment); return this; } public final RetryStrategy.Builder getRetryStrategy() { return retryStrategy != null ? retryStrategy.toBuilder() : null; } public final void setRetryStrategy(RetryStrategy.BuilderImpl retryStrategy) { this.retryStrategy = retryStrategy != null ? retryStrategy.build() : null; } @Override public final Builder retryStrategy(RetryStrategy retryStrategy) { this.retryStrategy = retryStrategy; return this; } public final RemoteDebugConfig.Builder getRemoteDebugConfig() { return remoteDebugConfig != null ? remoteDebugConfig.toBuilder() : null; } public final void setRemoteDebugConfig(RemoteDebugConfig.BuilderImpl remoteDebugConfig) { this.remoteDebugConfig = remoteDebugConfig != null ? remoteDebugConfig.build() : null; } @Override public final Builder remoteDebugConfig(RemoteDebugConfig remoteDebugConfig) { this.remoteDebugConfig = remoteDebugConfig; return this; } public final InfraCheckConfig.Builder getInfraCheckConfig() { return infraCheckConfig != null ? infraCheckConfig.toBuilder() : null; } public final void setInfraCheckConfig(InfraCheckConfig.BuilderImpl infraCheckConfig) { this.infraCheckConfig = infraCheckConfig != null ? infraCheckConfig.build() : null; } @Override public final Builder infraCheckConfig(InfraCheckConfig infraCheckConfig) { this.infraCheckConfig = infraCheckConfig; return this; } public final SessionChainingConfig.Builder getSessionChainingConfig() { return sessionChainingConfig != null ? sessionChainingConfig.toBuilder() : null; } public final void setSessionChainingConfig(SessionChainingConfig.BuilderImpl sessionChainingConfig) { this.sessionChainingConfig = sessionChainingConfig != null ? sessionChainingConfig.build() : null; } @Override public final Builder sessionChainingConfig(SessionChainingConfig sessionChainingConfig) { this.sessionChainingConfig = sessionChainingConfig; return this; } @Override public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) { super.overrideConfiguration(overrideConfiguration); return this; } @Override public Builder overrideConfiguration(Consumer builderConsumer) { super.overrideConfiguration(builderConsumer); return this; } @Override public CreateTrainingJobRequest build() { return new CreateTrainingJobRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy