/* * Copyright 2018-2023 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 com.amazonaws.services.sagemaker.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* Specifies the training algorithm to use in a CreateTrainingJob * request. *
** For more information about algorithms provided by SageMaker, see Algorithms. For information about using your * own algorithms, see Using Your Own * Algorithms with Amazon SageMaker. *
* * @see AWS * API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class AlgorithmSpecification implements Serializable, Cloneable, StructuredPojo { /** *
* The registry path of the Docker image that contains the training algorithm. For information about docker registry
* paths for SageMaker built-in algorithms, see Docker Registry
* Paths and Example Code in the Amazon SageMaker developer guide. SageMaker supports both
* registry/repository[:tag]
and registry/repository[@digest]
image path formats. For more
* information about using your custom training container, see Using Your Own Algorithms with Amazon
* SageMaker.
*
* You must specify either the algorithm name to the AlgorithmName
parameter or the image URI of the
* algorithm container to the TrainingImage
parameter.
*
* For more information, see the note in the AlgorithmName
parameter description.
*
* The name of the algorithm resource to use for the training job. This must be an algorithm resource that you * created or subscribe to on Amazon Web Services Marketplace. *
*
* You must specify either the algorithm name to the AlgorithmName
parameter or the image URI of the
* algorithm container to the TrainingImage
parameter.
*
* Note that the AlgorithmName
parameter is mutually exclusive with the TrainingImage
* parameter. If you specify a value for the AlgorithmName
parameter, you can't specify a value for
* TrainingImage
, and vice versa.
*
* If you specify values for both parameters, the training job might break; if you don't specify any value for both
* parameters, the training job might raise a null
error.
*
* A list of metric definition objects. Each object specifies the metric name and regular expressions used to parse * algorithm logs. SageMaker publishes each metric to Amazon CloudWatch. *
*/ private java.util.List
* To generate and save time-series metrics during training, set to true
. The default is
* false
and time-series metrics aren't generated except in the following cases:
*
* You use one of the SageMaker built-in algorithms *
** You use one of the following Prebuilt SageMaker Docker Images: *
** Tensorflow (version >= 1.15) *
** MXNet (version >= 1.6) *
** PyTorch (version >= 1.3) *
** You specify at least one MetricDefinition *
** The entrypoint script for a Docker container used * to run a training job. This script takes precedence over the default train processing instructions. See How Amazon * SageMaker Runs Your Training Image for more information. *
*/ private java.util.List* The arguments for a container used to run a training job. See How Amazon * SageMaker Runs Your Training Image for additional information. *
*/ private java.util.List* The configuration to use an image from a private Docker registry for a training job. *
*/ private TrainingImageConfig trainingImageConfig; /** *
* The registry path of the Docker image that contains the training algorithm. For information about docker registry
* paths for SageMaker built-in algorithms, see Docker Registry
* Paths and Example Code in the Amazon SageMaker developer guide. SageMaker supports both
* registry/repository[:tag]
and registry/repository[@digest]
image path formats. For more
* information about using your custom training container, see Using Your Own Algorithms with Amazon
* SageMaker.
*
* You must specify either the algorithm name to the AlgorithmName
parameter or the image URI of the
* algorithm container to the TrainingImage
parameter.
*
* For more information, see the note in the AlgorithmName
parameter description.
*
registry/repository[:tag]
and registry/repository[@digest]
image path
* formats. For more information about using your custom training container, see Using Your Own Algorithms with
* Amazon SageMaker.
* You must specify either the algorithm name to the AlgorithmName
parameter or the image URI of
* the algorithm container to the TrainingImage
parameter.
*
* For more information, see the note in the AlgorithmName
parameter description.
*
* The registry path of the Docker image that contains the training algorithm. For information about docker registry
* paths for SageMaker built-in algorithms, see Docker Registry
* Paths and Example Code in the Amazon SageMaker developer guide. SageMaker supports both
* registry/repository[:tag]
and registry/repository[@digest]
image path formats. For more
* information about using your custom training container, see Using Your Own Algorithms with Amazon
* SageMaker.
*
* You must specify either the algorithm name to the AlgorithmName
parameter or the image URI of the
* algorithm container to the TrainingImage
parameter.
*
* For more information, see the note in the AlgorithmName
parameter description.
*
registry/repository[:tag]
and registry/repository[@digest]
image path
* formats. For more information about using your custom training container, see Using Your Own Algorithms
* with Amazon SageMaker.
* You must specify either the algorithm name to the AlgorithmName
parameter or the image URI
* of the algorithm container to the TrainingImage
parameter.
*
* For more information, see the note in the AlgorithmName
parameter description.
*
* The registry path of the Docker image that contains the training algorithm. For information about docker registry
* paths for SageMaker built-in algorithms, see Docker Registry
* Paths and Example Code in the Amazon SageMaker developer guide. SageMaker supports both
* registry/repository[:tag]
and registry/repository[@digest]
image path formats. For more
* information about using your custom training container, see Using Your Own Algorithms with Amazon
* SageMaker.
*
* You must specify either the algorithm name to the AlgorithmName
parameter or the image URI of the
* algorithm container to the TrainingImage
parameter.
*
* For more information, see the note in the AlgorithmName
parameter description.
*
registry/repository[:tag]
and registry/repository[@digest]
image path
* formats. For more information about using your custom training container, see Using Your Own Algorithms with
* Amazon SageMaker.
* You must specify either the algorithm name to the AlgorithmName
parameter or the image URI of
* the algorithm container to the TrainingImage
parameter.
*
* For more information, see the note in the AlgorithmName
parameter description.
*
* The name of the algorithm resource to use for the training job. This must be an algorithm resource that you * created or subscribe to on Amazon Web Services Marketplace. *
*
* You must specify either the algorithm name to the AlgorithmName
parameter or the image URI of the
* algorithm container to the TrainingImage
parameter.
*
* Note that the AlgorithmName
parameter is mutually exclusive with the TrainingImage
* parameter. If you specify a value for the AlgorithmName
parameter, you can't specify a value for
* TrainingImage
, and vice versa.
*
* If you specify values for both parameters, the training job might break; if you don't specify any value for both
* parameters, the training job might raise a null
error.
*
* You must specify either the algorithm name to the AlgorithmName
parameter or the image URI of
* the algorithm container to the TrainingImage
parameter.
*
* Note that the AlgorithmName
parameter is mutually exclusive with the
* TrainingImage
parameter. If you specify a value for the AlgorithmName
parameter,
* you can't specify a value for TrainingImage
, and vice versa.
*
* If you specify values for both parameters, the training job might break; if you don't specify any value
* for both parameters, the training job might raise a null
error.
*
* The name of the algorithm resource to use for the training job. This must be an algorithm resource that you * created or subscribe to on Amazon Web Services Marketplace. *
*
* You must specify either the algorithm name to the AlgorithmName
parameter or the image URI of the
* algorithm container to the TrainingImage
parameter.
*
* Note that the AlgorithmName
parameter is mutually exclusive with the TrainingImage
* parameter. If you specify a value for the AlgorithmName
parameter, you can't specify a value for
* TrainingImage
, and vice versa.
*
* If you specify values for both parameters, the training job might break; if you don't specify any value for both
* parameters, the training job might raise a null
error.
*
* You must specify either the algorithm name to the AlgorithmName
parameter or the image URI
* of the algorithm container to the TrainingImage
parameter.
*
* Note that the AlgorithmName
parameter is mutually exclusive with the
* TrainingImage
parameter. If you specify a value for the AlgorithmName
* parameter, you can't specify a value for TrainingImage
, and vice versa.
*
* If you specify values for both parameters, the training job might break; if you don't specify any value
* for both parameters, the training job might raise a null
error.
*
* The name of the algorithm resource to use for the training job. This must be an algorithm resource that you * created or subscribe to on Amazon Web Services Marketplace. *
*
* You must specify either the algorithm name to the AlgorithmName
parameter or the image URI of the
* algorithm container to the TrainingImage
parameter.
*
* Note that the AlgorithmName
parameter is mutually exclusive with the TrainingImage
* parameter. If you specify a value for the AlgorithmName
parameter, you can't specify a value for
* TrainingImage
, and vice versa.
*
* If you specify values for both parameters, the training job might break; if you don't specify any value for both
* parameters, the training job might raise a null
error.
*
* You must specify either the algorithm name to the AlgorithmName
parameter or the image URI of
* the algorithm container to the TrainingImage
parameter.
*
* Note that the AlgorithmName
parameter is mutually exclusive with the
* TrainingImage
parameter. If you specify a value for the AlgorithmName
parameter,
* you can't specify a value for TrainingImage
, and vice versa.
*
* If you specify values for both parameters, the training job might break; if you don't specify any value
* for both parameters, the training job might raise a null
error.
*
* A list of metric definition objects. Each object specifies the metric name and regular expressions used to parse * algorithm logs. SageMaker publishes each metric to Amazon CloudWatch. *
* * @return A list of metric definition objects. Each object specifies the metric name and regular expressions used * to parse algorithm logs. SageMaker publishes each metric to Amazon CloudWatch. */ public java.util.List* A list of metric definition objects. Each object specifies the metric name and regular expressions used to parse * algorithm logs. SageMaker publishes each metric to Amazon CloudWatch. *
* * @param metricDefinitions * A list of metric definition objects. Each object specifies the metric name and regular expressions used to * parse algorithm logs. SageMaker publishes each metric to Amazon CloudWatch. */ public void setMetricDefinitions(java.util.Collection* A list of metric definition objects. Each object specifies the metric name and regular expressions used to parse * algorithm logs. SageMaker publishes each metric to Amazon CloudWatch. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setMetricDefinitions(java.util.Collection)} or {@link #withMetricDefinitions(java.util.Collection)} if * you want to override the existing values. *
* * @param metricDefinitions * A list of metric definition objects. Each object specifies the metric name and regular expressions used to * parse algorithm logs. SageMaker publishes each metric to Amazon CloudWatch. * @return Returns a reference to this object so that method calls can be chained together. */ public AlgorithmSpecification withMetricDefinitions(MetricDefinition... metricDefinitions) { if (this.metricDefinitions == null) { setMetricDefinitions(new java.util.ArrayList* A list of metric definition objects. Each object specifies the metric name and regular expressions used to parse * algorithm logs. SageMaker publishes each metric to Amazon CloudWatch. *
* * @param metricDefinitions * A list of metric definition objects. Each object specifies the metric name and regular expressions used to * parse algorithm logs. SageMaker publishes each metric to Amazon CloudWatch. * @return Returns a reference to this object so that method calls can be chained together. */ public AlgorithmSpecification withMetricDefinitions(java.util.Collection
* To generate and save time-series metrics during training, set to true
. The default is
* false
and time-series metrics aren't generated except in the following cases:
*
* You use one of the SageMaker built-in algorithms *
** You use one of the following Prebuilt SageMaker Docker Images: *
** Tensorflow (version >= 1.15) *
** MXNet (version >= 1.6) *
** PyTorch (version >= 1.3) *
** You specify at least one MetricDefinition *
*true
. The default is
* false
and time-series metrics aren't generated except in the following cases:
* * You use one of the SageMaker built-in algorithms *
** You use one of the following Prebuilt SageMaker Docker Images: *
** Tensorflow (version >= 1.15) *
** MXNet (version >= 1.6) *
** PyTorch (version >= 1.3) *
** You specify at least one MetricDefinition *
*
* To generate and save time-series metrics during training, set to true
. The default is
* false
and time-series metrics aren't generated except in the following cases:
*
* You use one of the SageMaker built-in algorithms *
** You use one of the following Prebuilt SageMaker Docker Images: *
** Tensorflow (version >= 1.15) *
** MXNet (version >= 1.6) *
** PyTorch (version >= 1.3) *
** You specify at least one MetricDefinition *
*true
. The default is
* false
and time-series metrics aren't generated except in the following cases:
* * You use one of the SageMaker built-in algorithms *
** You use one of the following Prebuilt SageMaker Docker Images: *
** Tensorflow (version >= 1.15) *
** MXNet (version >= 1.6) *
** PyTorch (version >= 1.3) *
** You specify at least one MetricDefinition *
*
* To generate and save time-series metrics during training, set to true
. The default is
* false
and time-series metrics aren't generated except in the following cases:
*
* You use one of the SageMaker built-in algorithms *
** You use one of the following Prebuilt SageMaker Docker Images: *
** Tensorflow (version >= 1.15) *
** MXNet (version >= 1.6) *
** PyTorch (version >= 1.3) *
** You specify at least one MetricDefinition *
*true
. The default is
* false
and time-series metrics aren't generated except in the following cases:
* * You use one of the SageMaker built-in algorithms *
** You use one of the following Prebuilt SageMaker Docker Images: *
** Tensorflow (version >= 1.15) *
** MXNet (version >= 1.6) *
** PyTorch (version >= 1.3) *
** You specify at least one MetricDefinition *
*
* To generate and save time-series metrics during training, set to true
. The default is
* false
and time-series metrics aren't generated except in the following cases:
*
* You use one of the SageMaker built-in algorithms *
** You use one of the following Prebuilt SageMaker Docker Images: *
** Tensorflow (version >= 1.15) *
** MXNet (version >= 1.6) *
** PyTorch (version >= 1.3) *
** You specify at least one MetricDefinition *
*true
. The default is
* false
and time-series metrics aren't generated except in the following cases:
* * You use one of the SageMaker built-in algorithms *
** You use one of the following Prebuilt SageMaker Docker Images: *
** Tensorflow (version >= 1.15) *
** MXNet (version >= 1.6) *
** PyTorch (version >= 1.3) *
** You specify at least one MetricDefinition *
** The entrypoint script for a Docker container used * to run a training job. This script takes precedence over the default train processing instructions. See How Amazon * SageMaker Runs Your Training Image for more information. *
* * @return The entrypoint script for a Docker * container used to run a training job. This script takes precedence over the default train processing * instructions. See How * Amazon SageMaker Runs Your Training Image for more information. */ public java.util.List* The entrypoint script for a Docker container used * to run a training job. This script takes precedence over the default train processing instructions. See How Amazon * SageMaker Runs Your Training Image for more information. *
* * @param containerEntrypoint * The entrypoint script for a Docker * container used to run a training job. This script takes precedence over the default train processing * instructions. See How * Amazon SageMaker Runs Your Training Image for more information. */ public void setContainerEntrypoint(java.util.Collection* The entrypoint script for a Docker container used * to run a training job. This script takes precedence over the default train processing instructions. See How Amazon * SageMaker Runs Your Training Image for more information. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setContainerEntrypoint(java.util.Collection)} or {@link #withContainerEntrypoint(java.util.Collection)} * if you want to override the existing values. *
* * @param containerEntrypoint * The entrypoint script for a Docker * container used to run a training job. This script takes precedence over the default train processing * instructions. See How * Amazon SageMaker Runs Your Training Image for more information. * @return Returns a reference to this object so that method calls can be chained together. */ public AlgorithmSpecification withContainerEntrypoint(String... containerEntrypoint) { if (this.containerEntrypoint == null) { setContainerEntrypoint(new java.util.ArrayList* The entrypoint script for a Docker container used * to run a training job. This script takes precedence over the default train processing instructions. See How Amazon * SageMaker Runs Your Training Image for more information. *
* * @param containerEntrypoint * The entrypoint script for a Docker * container used to run a training job. This script takes precedence over the default train processing * instructions. See How * Amazon SageMaker Runs Your Training Image for more information. * @return Returns a reference to this object so that method calls can be chained together. */ public AlgorithmSpecification withContainerEntrypoint(java.util.Collection* The arguments for a container used to run a training job. See How Amazon * SageMaker Runs Your Training Image for additional information. *
* * @return The arguments for a container used to run a training job. See How * Amazon SageMaker Runs Your Training Image for additional information. */ public java.util.List* The arguments for a container used to run a training job. See How Amazon * SageMaker Runs Your Training Image for additional information. *
* * @param containerArguments * The arguments for a container used to run a training job. See How * Amazon SageMaker Runs Your Training Image for additional information. */ public void setContainerArguments(java.util.Collection* The arguments for a container used to run a training job. See How Amazon * SageMaker Runs Your Training Image for additional information. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setContainerArguments(java.util.Collection)} or {@link #withContainerArguments(java.util.Collection)} if * you want to override the existing values. *
* * @param containerArguments * The arguments for a container used to run a training job. See How * Amazon SageMaker Runs Your Training Image for additional information. * @return Returns a reference to this object so that method calls can be chained together. */ public AlgorithmSpecification withContainerArguments(String... containerArguments) { if (this.containerArguments == null) { setContainerArguments(new java.util.ArrayList* The arguments for a container used to run a training job. See How Amazon * SageMaker Runs Your Training Image for additional information. *
* * @param containerArguments * The arguments for a container used to run a training job. See How * Amazon SageMaker Runs Your Training Image for additional information. * @return Returns a reference to this object so that method calls can be chained together. */ public AlgorithmSpecification withContainerArguments(java.util.Collection* The configuration to use an image from a private Docker registry for a training job. *
* * @param trainingImageConfig * The configuration to use an image from a private Docker registry for a training job. */ public void setTrainingImageConfig(TrainingImageConfig trainingImageConfig) { this.trainingImageConfig = trainingImageConfig; } /** ** The configuration to use an image from a private Docker registry for a training job. *
* * @return The configuration to use an image from a private Docker registry for a training job. */ public TrainingImageConfig getTrainingImageConfig() { return this.trainingImageConfig; } /** ** The configuration to use an image from a private Docker registry for a training job. *
* * @param trainingImageConfig * The configuration to use an image from a private Docker registry for a training job. * @return Returns a reference to this object so that method calls can be chained together. */ public AlgorithmSpecification withTrainingImageConfig(TrainingImageConfig trainingImageConfig) { setTrainingImageConfig(trainingImageConfig); return this; } /** * 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. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getTrainingImage() != null) sb.append("TrainingImage: ").append(getTrainingImage()).append(","); if (getAlgorithmName() != null) sb.append("AlgorithmName: ").append(getAlgorithmName()).append(","); if (getTrainingInputMode() != null) sb.append("TrainingInputMode: ").append(getTrainingInputMode()).append(","); if (getMetricDefinitions() != null) sb.append("MetricDefinitions: ").append(getMetricDefinitions()).append(","); if (getEnableSageMakerMetricsTimeSeries() != null) sb.append("EnableSageMakerMetricsTimeSeries: ").append(getEnableSageMakerMetricsTimeSeries()).append(","); if (getContainerEntrypoint() != null) sb.append("ContainerEntrypoint: ").append(getContainerEntrypoint()).append(","); if (getContainerArguments() != null) sb.append("ContainerArguments: ").append(getContainerArguments()).append(","); if (getTrainingImageConfig() != null) sb.append("TrainingImageConfig: ").append(getTrainingImageConfig()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof AlgorithmSpecification == false) return false; AlgorithmSpecification other = (AlgorithmSpecification) obj; if (other.getTrainingImage() == null ^ this.getTrainingImage() == null) return false; if (other.getTrainingImage() != null && other.getTrainingImage().equals(this.getTrainingImage()) == false) return false; if (other.getAlgorithmName() == null ^ this.getAlgorithmName() == null) return false; if (other.getAlgorithmName() != null && other.getAlgorithmName().equals(this.getAlgorithmName()) == false) return false; if (other.getTrainingInputMode() == null ^ this.getTrainingInputMode() == null) return false; if (other.getTrainingInputMode() != null && other.getTrainingInputMode().equals(this.getTrainingInputMode()) == false) return false; if (other.getMetricDefinitions() == null ^ this.getMetricDefinitions() == null) return false; if (other.getMetricDefinitions() != null && other.getMetricDefinitions().equals(this.getMetricDefinitions()) == false) return false; if (other.getEnableSageMakerMetricsTimeSeries() == null ^ this.getEnableSageMakerMetricsTimeSeries() == null) return false; if (other.getEnableSageMakerMetricsTimeSeries() != null && other.getEnableSageMakerMetricsTimeSeries().equals(this.getEnableSageMakerMetricsTimeSeries()) == false) return false; if (other.getContainerEntrypoint() == null ^ this.getContainerEntrypoint() == null) return false; if (other.getContainerEntrypoint() != null && other.getContainerEntrypoint().equals(this.getContainerEntrypoint()) == false) return false; if (other.getContainerArguments() == null ^ this.getContainerArguments() == null) return false; if (other.getContainerArguments() != null && other.getContainerArguments().equals(this.getContainerArguments()) == false) return false; if (other.getTrainingImageConfig() == null ^ this.getTrainingImageConfig() == null) return false; if (other.getTrainingImageConfig() != null && other.getTrainingImageConfig().equals(this.getTrainingImageConfig()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getTrainingImage() == null) ? 0 : getTrainingImage().hashCode()); hashCode = prime * hashCode + ((getAlgorithmName() == null) ? 0 : getAlgorithmName().hashCode()); hashCode = prime * hashCode + ((getTrainingInputMode() == null) ? 0 : getTrainingInputMode().hashCode()); hashCode = prime * hashCode + ((getMetricDefinitions() == null) ? 0 : getMetricDefinitions().hashCode()); hashCode = prime * hashCode + ((getEnableSageMakerMetricsTimeSeries() == null) ? 0 : getEnableSageMakerMetricsTimeSeries().hashCode()); hashCode = prime * hashCode + ((getContainerEntrypoint() == null) ? 0 : getContainerEntrypoint().hashCode()); hashCode = prime * hashCode + ((getContainerArguments() == null) ? 0 : getContainerArguments().hashCode()); hashCode = prime * hashCode + ((getTrainingImageConfig() == null) ? 0 : getTrainingImageConfig().hashCode()); return hashCode; } @Override public AlgorithmSpecification clone() { try { return (AlgorithmSpecification) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } @com.amazonaws.annotation.SdkInternalApi @Override public void marshall(ProtocolMarshaller protocolMarshaller) { com.amazonaws.services.sagemaker.model.transform.AlgorithmSpecificationMarshaller.getInstance().marshall(this, protocolMarshaller); } }